Nagios Command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Command

Post by raamardhani7 »

Thanks again, eloyd
have a nice weekend *^.^*
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Command

Post by rkennedy »

Are we good to mark this thread as resolved?
Former Nagios Employee
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Command

Post by raamardhani7 »

We will test and let you know.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Command

Post by rkennedy »

Sounds good, let us know if you need any further assistance.
Former Nagios Employee
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Command

Post by raamardhani7 »

Hi,

I have installed NRDP on the Nagios XI server. However, I'd like to send some command to the NRDP server and receive below results from remote server.
OK, mccdev, MCCD13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.15.30 in 00.15.08 h.m.s.
OK, mccqa, MCCQ13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.17.56 in 00.01.07 h.m.s.
OK, mccref, MCCR13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.20.47 in 00.01.34 h.m.s.
OK, mcctrain, MCCT13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.23.28 in 00.01.06 h.m.s.
OK, plmdev, PLMD14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.27.59 in 00.02.52 h.m.s.
OK, plmqa, PLMQ14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.32.30 in 00.03.06 h.m.s.
OK, plmref, PLMR14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.35.26 in 00.01.22 h.m.s.
OK, plmsand, PLMS14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.42.07 in 00.05.10 h.m.s.
OK, plmstag, STG14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.47.34 in 00.04.06 h.m.s.
OK, plmtrain, PLMT14X, ONLINE INCREMENTAL completed on 04/13/16 at 21.02.04 in 00.12.39 h.m.s.


Here are my questions:
1. Do we need to install nrdp.php on the each remote servers?
2. How would i receive above results from the each remote server with commands? I mean what is the syntax for this?
3. Once I typed the below command, I did not receive any result:
/usr/bin/php /usr/local/nrdp/clients/send_nrdp.php --url=http://10.10.83.90/nrdp --token=asd7fjk3l34 --host==172.28.45.13 --service=ping --state=0 --output="The service looks okay"

note: 10.10.83.90: NRPD server
172.28.45.13: remote server
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Nagios Command

Post by bwallace »

1. Do we need to install nrdp.php on the each remote servers?
Yes. See bottom of page 3, here https://assets.nagios.com/downloads/nrd ... 1456514247
2. How would i receive above results from the each remote server with commands? I mean what is the syntax for this?
As tmcdonald mentioned, "The way around this is to run this as a passive check on a cron, and write directly to the nagios.cmd file to generate an alert for each match" he posted links with examples. Can you post what you have thus far?
3. Once I typed the below command, I did not receive any result:
/usr/bin/php /usr/local/nrdp/clients/send_nrdp.php --url=http://10.10.83.90/nrdp --token=asd7fjk3l34 --host==172.28.45.13 --service=ping --state=0 --output="The service looks okay"
To clarify , did you install the NDRP client on 172.28.45.13? I ask because of question #1 -- thanks -
Be sure to check out the Knowledgebase for helpful articles and solutions!
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Command

Post by raamardhani7 »

OK. I will install on the remote server. However, I'd like to clarify one thing.

If I'd like to generate alert for each line of below file using NRDP. Would there be any problem?

OK, mccdev, MCCD13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.15.30 in 00.15.08 h.m.s.
OK, mccqa, MCCQ13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.17.56 in 00.01.07 h.m.s.
OK, mccref, MCCR13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.20.47 in 00.01.34 h.m.s.
OK, mcctrain, MCCT13X, ONLINE INCREMENTAL completed on 04/13/16 at 20.23.28 in 00.01.06 h.m.s.
OK, plmdev, PLMD14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.27.59 in 00.02.52 h.m.s.
OK, plmqa, PLMQ14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.32.30 in 00.03.06 h.m.s.
OK, plmref, PLMR14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.35.26 in 00.01.22 h.m.s.
OK, plmsand, PLMS14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.42.07 in 00.05.10 h.m.s.
OK, plmstag, STG14X, ONLINE INCREMENTAL completed on 04/13/16 at 20.47.34 in 00.04.06 h.m.s.
OK, plmtrain, PLMT14X, ONLINE INCREMENTAL completed on 04/13/16 at 21.02.04 in 00.12.39 h.m.s
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Nagios Command

Post by raamardhani7 »

Hi,
I have installed NRDP on the Nagios XI (10.10.83.90) and remote (172.28.45.13) servers. However, once I typed the below command, I did not receive any result:
/usr/bin/php /usr/local/nrdp/clients/send_nrdp.php --url=http://10.10.83.90/nrdp --token=asd7fjk3l34 --host==172.28.45.13 --service=ping --state=0 --output="The service looks okay"
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Command

Post by tmcdonald »

--host==172.28.45.13
Was that a typo? I don't know if double-equals will matter but just to make sure, can you confirm whether you had a single or double?

Update: To address your previous question, you can certainly do this using the method I described before, otherwise you will need to either send each line to a different service, or set up a single service as a volatile service:

https://assets.nagios.com/downloads/nag ... vices.html

That, or use Nagios Logserver for this sort of thing, which is much better suited for parsing log entries.
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Command

Post by lmiltchev »

/usr/bin/php /usr/local/nrdp/clients/send_nrdp.php --url=http://10.10.83.90/nrdp --token=asd7fjk3l34 --host==172.28.45.13 --service=ping --state=0 --output="The service looks okay"
Is this a typo? It should be:
/usr/bin/php /usr/local/nrdp/clients/send_nrdp.php --url=http://10.10.83.90/nrdp --token=asd7fjk3l34 --host=172.28.45.13 --service=ping --state=0 --output="The service looks okay"
Also, can you verify this is a valid token? To check, run the following command from the CLI on 10.10.83.90:

Code: Select all

grep authorized_tokens /usr/local/nrdp/server/config.inc.php
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked