AWS have a CloudWatch agent which will submit a number of useful (configurable) metrics, including
inodes_total. They'll appear, by default, under the
CWAgent namespace in CloudWatch metrics from where you can view them, add them to dashboards, create alarms etc.
For the full details, these links will be useful:
Alternatively, the quickest way to get started is to:
- Download the agent from https://s3.amazonaws.com/amazoncloudwatch-agent/linux/amd64/latest/AmazonCloudWatchAgent.zip
- Unzip and run
- Start the agent by running
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a start (this will create a default config file)
- Edit the default config file at
/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json and modify the
metrics_collected to include the inode metrics under the
disk category (see below for sample).
- Stop (above command but with
-a stop instead) and start the agent for the new config to take effect.
You should then see the new metrics appear in CloudWatch within a minute or so. The agent should also automatically start at boot.
Here's a sample of defining the inode metrics (for full details see the configuration docs):