PMP-CHE...-RDS.PY(7)
β¨ NAME β¨
okay so bestie, gather round π this is pmp-check-aws-rds.py β it checks your Amazon RDS metrics. that's the whole vibe. that's the job. periodt.
π SYNOPSIS π
here's how you call her:
Usage: pmp-check-aws-rds.py [options]
Options:
-h, --help show this help message and exit
-l, --list list of all DB instances
-n PROFILE, --profile-name=PROFILE
AWS profile from ~/.boto or /etc/boto.cfg. Default:
None, fallbacks to "[Credentials]".
-r REGION, --region=REGION
AWS region. Default: us-east-1. If set to "all", we
try to detect the instance region across all of them,
note this will be slower than you specify the region.
-i IDENT, --ident=IDENT
DB instance identifier
-p, --print print status and other details for a given DB instance
-m METRIC, --metric=METRIC
metric to check: [status, load, storage, memory]
-w WARN, --warn=WARN warning threshold
-c CRIT, --crit=CRIT critical threshold
-u UNIT, --unit=UNIT unit of thresholds for "storage" and "memory" metrics:
[percent, GB]. Default: percent
-t TIME, --time=TIME time period in minutes to query. Default: 5
-a AVG, --avg=AVG time average in minutes to request. Default: 1
-f, --forceunknown force alerts on unknown status. This prevents issues
related to AWS Cloudwatch throttling limits Default:
False
-d, --debug enable debug output
and now every single one of those flags, lovingly unpacked π (no skips, we don't do skips here)
πΈ OPTIONS πΈ
-h,--helpβ shows this help message and dips. iconic behaviour honestly π-l,--listβ gives you the list of all DB instances. the whole roster, main character energy π-n PROFILE,--profile-name=PROFILEβ AWS profile pulled from~/.botoor/etc/boto.cfg. Default:None, and it fallbacks to"[Credentials]". so if you don't say anything, she goes hunting for that section herself.-r REGION,--region=REGIONβ the AWS region. Default:us-east-1. πΊοΈ and here's the tea: if you set it to"all", she'll try to detect the instance region across all of them β but note this will be slower than you specifying the region. no cap, she's just doing more work.-i IDENT,--ident=IDENTβ the DB instance identifier. like, which one are we talking about bestie π«Ά-p,--printβ prints the status and other details for a given DB instance. the full gossip report π-m METRIC,--metric=METRICβ which metric to check:[status, load, storage, memory]. pick your fighter β-w WARN,--warn=WARNβ the warning threshold.-c CRIT,--crit=CRITβ the critical threshold. this is the "okay now we PANIC" line π-u UNIT,--unit=UNITβ the unit of thresholds for the"storage"and"memory"metrics:[percent, GB]. Default:percent. choose wisely π-t TIME,--time=TIMEβ time period in minutes to query. Default:5.-a AVG,--avg=AVGβ time average in minutes to request. Default:1.-f,--forceunknownβ forces alerts on unknown status. this prevents issues related to AWS Cloudwatch throttling limits. Default:False. lowkey a lifesaver when CloudWatch is being dramatic π-d,--debugβ enables debug output. for when you simply must see everything π¦
π§ REQUIREMENTS π§
so this plugin is written on Python and utilizes the module "boto" (that's the Python interface to Amazon Web Services) to get various RDS metrics from CloudWatch and compare them against the thresholds. slay.
- Install the package:
yum install python-botoorapt-get install python-boto - Create a config
/etc/boto.cfgor~nagios/.botowith your AWS API credentials. Seehttp://code.google.com/p/boto/wiki/BotoConfig
this plugin, which is supposed to be run by Nagios, i.e. under nagios user, should have permissions to read the config /etc/boto.cfg or ~nagios/.boto. so like, give her reading rights or she cannot function bestie π€
Example:
[root@centos6 ~]# cat /etc/boto.cfg
[Credentials]
aws_access_key_id = THISISATESTKEY
aws_secret_access_key = thisisatestawssecretaccesskey
if you don't use this config with other tools (like our Cacti script, hiii π), you can secure this file the following way:
[root@centos6 ~]# chown nagios /etc/boto.cfg
[root@centos6 ~]# chmod 600 /etc/boto.cfg
lock it down, she's yours only ππ
π¦ DESCRIPTION π¦
the plugin provides 4 checks and some options to list and print RDS details:
- RDS Status
- RDS Load Average
- RDS Free Storage
- RDS Free Memory
to get the list of all RDS instances under your AWS account:
# ./pmp-check-aws-rds.py -l
to get the detailed status of the RDS instance identified as "blackbox":
# ./pmp-check-aws-rds.py -i blackbox -p
Nagios check for the overall status. useful if you want to set the rest of the checks dependent from this one:
# ./pmp-check-aws-rds.py -i blackbox -m status
OK mysql 5.1.63. Status: available
Nagios check for CPU utilization β specify thresholds as percentage of 1-min., 5-min., 15-min. average accordingly:
# ./pmp-check-aws-rds.py -i blackbox -m load -w 90,85,80 -c 98,95,90
OK Load average: 18.36%, 18.51%, 15.95% | load1=18.36;90.0;98.0;0;100 load5=18.51;85.0;95.0;0;100 load15=15.95;80.0;90.0;0;100
Nagios check for the free memory, specify thresholds as percentage:
# ./pmp-check-aws-rds.py -i blackbox -m memory -w 5 -c 2
OK Free memory: 5.90 GB (9%) of 68 GB | free_memory=8.68;5.0;2.0;0;100
# ./pmp-check-aws-rds.py -i blackbox -m memory -u GB -w 4 -c 2
OK Free memory: 5.90 GB (9%) of 68 GB | free_memory=5.9;4.0;2.0;0;68
Nagios check for the free storage space, specify thresholds as percentage or GB:
# ./pmp-check-aws-rds.py -i blackbox -m storage -w 10 -c 5
OK Free storage: 162.55 GB (33%) of 500.0 GB | free_storage=32.51;10.0;5.0;0;100
# ./pmp-check-aws-rds.py -i blackbox -m storage -u GB -w 10 -c 5
OK Free storage: 162.55 GB (33%) of 500.0 GB | free_storage=162.55;10.0;5.0;0;500.0
by default, the region is set to us-east-1. you can re-define it globally in boto config or specify with the -r option. the following command will list all instances across all regions under your AWS account:
# ./pmp-check-aws-rds.py -r all -l
the following command will show the status for the first instance identified as blackbox in all regions:
# ./pmp-check-aws-rds.py -r all -i blackbox -p
reminder bestie: scanning regions are a slower operation than specifying it explicitly. β³ don't say I didn't warn you.
π CONFIGURATION π
here's the excerpt of a potential Nagios config, in all its glory:
define host{
use mysql-host
host_name blackbox
alias blackbox
address blackbox.abcdefgh.us-east-1.rds.amazonaws.com
}
define servicedependency{
host_name blackbox
service_description RDS Status
dependent_service_description RDS Load Average, RDS Free Storage, RDS Free Memory
execution_failure_criteria w,c,u,p
notification_failure_criteria w,c,u,p
}
define service{
use active-service
host_name blackbox
service_description RDS Status
check_command check_rds!status!0!0
}
define service{
use active-service
host_name blackbox
service_description RDS Load Average
check_command check_rds!load!90,85,80!98,95,90
}
define service{
use active-service
host_name blackbox
service_description RDS Free Storage
check_command check_rds!storage!10!5
}
define service{
use active-service
host_name blackbox
service_description RDS Free Memory
check_command check_rds!memory!5!2
}
define command{
command_name check_rds
command_line $USER1$/pmp-check-aws-rds.py -i $HOSTALIAS$ -m $ARG1$ -w $ARG2$ -c $ARG3$
}
copy it, tweak it, make it yours π β¨
π COPYRIGHT, LICENSE, AND WARRANTY π
this program is copyright 2014 Percona LLC and/or its affiliates. feedback and improvements are welcome β fr fr, they want to hear from you π«Ά
THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. π like, she comes as-is, no promises, no pinky swear.
this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. you should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
β VERSION β
$PROJECT_NAME$ pmp-check-aws-rds.py $VERSION$
and that's the whole page bestie π this one's from the User Contributed Perl Documentation section, page PMP-CHE...-RDS.PY(7), and it's signed off as perl v5.40.1, dated 2026-02-11. go forth and monitor those RDS instances, you absolute icon ππ periodt.
π¦ where this page comes from
- ubuntu resolute: monitoring-plugins-contrib 48.20250420ubuntu3
- ubuntu stonking: monitoring-plugins-contrib 48.20250420ubuntu3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms