Need Help deploying my own plugins

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mlasala
Posts: 3
Joined: Wed Apr 20, 2011 8:05 am

Need Help deploying my own plugins

Post by mlasala »

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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Need Help deploying my own plugins

Post by mguthrie »

Check the permissions of the script to see if it matches the other plugins. Does the nagios process have execute permissions?
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Need Help deploying my own plugins

Post by niebais »

mguthrie wrote:Check the permissions of the script to see if it matches the other plugins. Does the nagios process have execute permissions?
Mcgurthie is right.

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".
Locked