Page 1 of 1
Nagios configuration error
Posted: Thu Aug 21, 2014 3:39 am
by parveenfathima.m
Hi guys,
I am new to nagios monitoring tool. I successfully tested the predefined monitoring wizard given by nagios. Now i am decided to create a custom plugin using java. I created that, But i can't able to deploy my custom plugin into nagios. Help me how to solve it.
Re: Nagios configuration error
Posted: Thu Aug 21, 2014 9:25 am
by tmcdonald
What steps have you taken so far and where is it failing?
Did you follow this guide?
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
Re: Nagios configuration error
Posted: Fri Aug 22, 2014 4:02 am
by parveenfathima.m
HI,
Yes i followed the link for as you gave. I have attached following steps to make a deployment,
1. Install jnrpe server and jcheck server into nagiox server machine.
2. Then go to change the file jnrpe.ini located inside of jnrpe server->etc folder. To insert a below line under [commands] and removing older one in jnrpe.ini file.
check_disk : CHECK_DISK -d $ARG1$ -w $ARG2$ -c $ARG3$
3. Make one directory to store our custom plugin.
path must be, jnrpe_server -> plugins -> tutorial(custom folder name) -> put the jar into this location.
3. start the jnrpe server service using following command.
./jnrpe -c ../etc/jnrpe.ini
4. After service started then goto jcheck_nrpe location for running the plugin.
cd /tmp/jcheck_nrpe-2.0.3-RC3/bin
./jcheck_nrpe -H localhost -c-n -c check_disk -d /tmp :100000 :50000
Re: Nagios configuration error
Posted: Fri Aug 22, 2014 3:01 pm
by sreinhardt
What responses are you getting when attempting to run the final command? Are there any logs with the jnrpe package? Sorry this is the first I've heard of nrpe in java, and I would strongly suggest using the base nrpe package instead unless you really need a java based environment for something, check_disk is a standard plugin and should not need java.
Re: Nagios configuration error
Posted: Tue Aug 26, 2014 2:15 am
by parveenfathima.m
hi guys,
"bad file (invalid format)" can be display when running the plugin on nagios xi server.
Re: Nagios configuration error
Posted: Tue Aug 26, 2014 4:12 pm
by abrist
Is there a reason why this was written in java? We would need to see the plugin to even begin troubleshooting as it is a custom thing. But just to reiterate, disk checking in no way requires java, and we already include similar checks for all major platforms by default in XI.
Re: Nagios configuration error
Posted: Wed Aug 27, 2014 5:54 am
by parveenfathima.m
Hi,
I have the requirements are based on java language, for that i used java. can u tell me if nagios can monitor jar file script?. If possible means send me some of the related links. i searched a lot, but i can't get the clear idea about to create a java custom plugin using nagios.
Re: Nagios configuration error
Posted: Wed Aug 27, 2014 10:14 am
by abrist
First, how are you running the plugin - through which agent?
NRPE, NSCA, NCPA, NSClient, check_by_ssh, locally on the XI server, etc. . .
Next, are you following the plugin dev guidelines?
https://nagios-plugins.org/doc/guidelines.html
Re: Nagios configuration error
Posted: Tue Feb 17, 2015 8:37 am
by ziccardi
I'm a bit late with the answer, but I prefer to add the answer so that other people can find it here.
I'm the founder of the JNRPE project.
What's wrong in your installation is the command you use.
Infact you say you use the command:
Code: Select all
./jcheck_nrpe -H localhost -c-n -c check_disk -d /tmp :100000 :50000
Have you tried to execute it on the command line? It won't work.
jcheck_nrpe has exactly the same syntax as check_nrpe, so you will have to run it with:
Code: Select all
./jcheck_nrpe -H localhost -n -c check_disk -a /tmp :100000 :50000
Moreover, JNRPE is fully compatible with NRPE, so I would suggest you use check_nrpe to invoke commands on JNRPE:
Code: Select all
./check_nrpe -H localhost -n -c check_disk -a /tmp :100000 :50000
(jcheck_nrpe is provided for systems where check_nrpe is not available)
Regards,
Massimiliano
Re: Nagios configuration error
Posted: Tue Feb 17, 2015 11:29 am
by abrist
Thanks for the additional info!
OP: Did ziccardi's fix work for you?