Hello,
I've installed Nagios Core 3.2.0 on a VM.
I've also installed nrpe in other twelve VM.
All it's working perfectly with their own plugins but now i'm trying to create my own plugin to monitor Apache MQ.
These are the steps i've been following:
I've modified the file /etc/nagios3/conf.d/services.cfg (nagios Core VM) and i've added next lines:
define service{
use generic-service,srv-pnp
host_name MyServerName
service_description Apache Active Message Queue
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_amqisalive
}
I've also added the file amqisalive.cfg in path: /etc/nagios-plugins/config (on nagios Core VM) with those lines:
define command{
command_name check_amqisalive
command_line /usr/lib/nagios/plugins/check_amqisalive.sh $HOSTADDRESS$
}
Finally in path /usr/lib/nagios/plugins/ i created the file check_amqisalive.sh with this content:
java -cp /usr/lib/nagios/plugins/amqIsAlive:/usr/lib/nagios/plugins/amqIsAlive/lib/* test.com.mykoots.jms.AmqIsAliveTest $1 > /var/log/nagios3/amqisalive.log 2>&1
On the same path exist a folder called amqIsAlive were the java script exists.
If i execute ./check_amqisalive.sh MyServerName it returns 0 and a short message OK - bla bla bla bla ...
But it doesn't work, i only see that MyServerName (a remote machine with NRPE installed) is in Status "CRITICAL" and the Status Information returns the value (null).
Can someone tell me what i'm doing wrong plz?
Thanks!
Mariano Lasala
Need Help deploying my own plugins
Re: Need Help deploying my own plugins
Check the permissions of the script to see if it matches the other plugins. Does the nagios process have execute permissions?
Re: Need Help deploying my own plugins
Mcgurthie is right.mguthrie wrote:Check the permissions of the script to see if it matches the other plugins. Does the nagios process have execute permissions?
Custom scripts are really easy:
1) Make sure they print out a line of text
2) Make sure they exit with the right error code: 0,1,2,3
3) Make sure they are executable
Try this command: "chmod 755 /usr/lib/nagios/plugins/check_amqisalive.sh".