This article will explain how to use the check_monit_tpt.py plugin to pull your monit data into OP5. We will walk you through some examples with OP5 but this plugin should work equally well with nagios or other derivatives. You can download the plugin from our gitlab repository linked below.
Using this plugin, you will be able to get CPU and Memory usage for your services and build performance data for graphing in OP5. Additionally, passing warning and critical thresholds will allow for alerting if those thresholds are passed.
Here is what the basic usage for this plugin looks like:
check_monit_tpt.py -H <host> -u <user> -P <password> -S <service> <-C or -M or -S> -w <warning> -c <critical>
When using arguments -C <cpu stats> -M <memory stats> or -S <all stats>. For CPU and Memory you must pass -w <warning and -c <critical> thresholds. The -S <status/all stats> does not need the threshold options, output will show all stats of service passed along with whether the service is running. Note: Performance data is only created for -C <cpu stats> and -M <memory stats>.
Here are some examples of check commands:
Services being monitored by Monit:
./check_monit_tpt.py -H <host> -u <username> -P <password>
This check will just output all the services that Monit is monitoring to OP5 or Nagios
Apache CPU Usage:
./check_monit_tpt.py -H <host> -u <username> -P <password> -s httpd -C -w 40 -c 50
MySQL Memory Usage:
./check_monit_tpt.py -H <host> -u <username> -P <password> -s httpd -C -w 40 -c 50
For -w <warning> and critical <critical> thresholds enter integer between [0-100]
Example of OP5 check command using this plugin:
Example of OP5 service-check using the above check command to check Apache CPU Usage:
Example host view of the above Apache CPU Usage service-check:
Example view of Apache CPU Usage perfdata:
To download this plugin click on the link below:
To download Monit click on the link below:
Monit How-To: