As a prerequisite, the monitoring server is the UBUNTU14 operating system. The monitored server is RHEL6.5 RHEL7
1. Custom plugins can be implemented using scripts such as bash, Python, and so on.
2, through the Nrpe plug-in to achieve monitoring server and monitored host communication between
3, must pay attention to the monitoring script belongs to the user, user group, should be Nagios
4, custom plug-ins, need to be deployed on the monitored host, while modifying/etc/nagios/nrpe.cfg add monitoring command configuration, the following example: (the monitored host needs to restart the service to take effect Nrpe restart)
command[check_activemq_queues]=sudo/usr/lib64/nagios/plugins/libexec/check_activemq_queues.sh
5, the Monitoring server to add the corresponding command (/ETC/NAGIOS3/COMMANDS.CFG)
Define command{ command_name check_activemq_queues command_line /usr/lib/nagios/plugins/check_ activemq_queues.sh $ARG 1$ $ARG 2$ $ARG 3$ }
6, monitoring server on the same need to include this monitoring script. In this directory/usr/lib/nagios/plugins/also need to pay attention to the owner of the script.
7, monitoring server, add a new monitoring service configuration, in the/etc/nagios3/servers/below the corresponding server configuration, add a service definition.
Define service{ use generic-service host_name xx.xx.xx service_description ActiveMQ Status check_command check_nrpe_1arg!check_activemq_queues }
Check_nrpe_1arg This parameter, specifies the monitor server to execute the script, does not pass in the custom parameter, executes the script directly. This configuration needs to be reconciled on the monitoring server and the monitored host, otherwise there will be a communication error.
8, the monitoring server needs to reload the configuration file to take effect. Service NAGIOS3 Reload
Nagios monitoring ACTIVEMQ plug-in development and deployment considerations