Running Nagios plugins on clusters
Posted: Mon Aug 10, 2015 9:41 am
I am building a plugin designed to run on the admin and leader nodes of a cluster, checking textfiles stored in the same locations on all the nodes (say, /tmp/testlog.txt). When it is done scanning through the file, it shows the file offset in the perfdata, to prove it doesn't have to scan from the beginning at each execution. I'm experimenting with what lines to keep in what config files to activate the plugin, and this is basically what I have on the admin node:
in the commands.cfg:
in allservices.cfg
in localhost.cfg
And in the web interface, the check_thing check is shown under the admin node (localhost) and the leader nodes (leader1, leader2, etc). However, it is only checking the textfile stored in the admin node. I can tell because when I look at the perfdata for each check, they all reflect the same file offset after running, even though the txtfiles are of different sizes on each node.
I'm wondering if there is a step I'm missing to have the plugin check the other files. Looking at the default check_ping installed, it has no problem checking each node it's supposed to and reflecting their individual sets of data. I'm pretty sure I don't need the nrpe stuff for this, but the cluster documentation with nagios does not look all too relevant for my uses. Though I may just be misunderstanding the workflow.
Any help would be appreciated! Thank you
in the commands.cfg:
Code: Select all
#check_thing command definition
define command {
command_name check_txt
command_line $USER1$/check_thing -w $ARG1$ -c $ARG2$
}
Code: Select all
define service{
use generic-service
hostgroup all
service_description check_txt
check_command check_txt!5!10
}
Code: Select all
define service{
use local-service
host_name localhost
service_description check_txt
check_command check_txt!5!10
}
I'm wondering if there is a step I'm missing to have the plugin check the other files. Looking at the default check_ping installed, it has no problem checking each node it's supposed to and reflecting their individual sets of data. I'm pretty sure I don't need the nrpe stuff for this, but the cluster documentation with nagios does not look all too relevant for my uses. Though I may just be misunderstanding the workflow.
Any help would be appreciated! Thank you