Use NSCA easily with nsca-wrapper modified
Written by Adrien le Maire - 25 march 2011
Nagios's aim is to monitor a lot of different services on differents operating systems.
To allow to check a huge number of services, the monitoring server need a big computing capacity, or change your way to perform the checks, and ensure that your monitored hosts send the state of each service to the Nagios server. That's why I choose NSCA. Just install the server package on your Nagios host, then the nagios-plugins on the remote; and I perform the checks automaticaly with nsca-wrapper.
I was using nsca-wrapper but, I though that's use to much my database, so, I decide to modify the script NSCA Wrapper available on Nagios Exchange.
I wanna get any modification of the state of my monitored services.
So it doesn't have to send update if no change.
I decide to add the "memory" option to that script.
It needs as argument, a folder in witch the state of all commands will be safe.
To generate the name of each file, I choose to use a md5 hash of the command.
Now, I'm sending my nsca checks using cron with a file grouping all my commands like :
[code lang="bash"]NSCA_WRAPPER="/etc/nagios-plugins/nsca_wrapper -N watch -b /usr/sbin/send_nsca -c /etc/send_nsca.cfg -d /var/local/nsca -q -H dom0"
$NSCA_WRAPPER -S SSH -C '/usr/lib/nagios/plugins/check_ssh '127.0.0.1'' [/code]
Here is my modify version : nsca_wrapper.tar.gz
Enjoy :-)Classified in : Linux, Monitoring - Tags : NSCA, Nagios, Automated, cron