NRDP send command

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.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

NRDP send command

Post by tariqondego »

I have NRDP server running at central.I have remote clients that need to send commands to the NRDP server and recieve results.Each client has send_nrdp.php installed.
How would i go about querying the server with commands? I mean what is the syntax for this?
And is there a way to schedule(autorun) this tasks,instead of having to type commands each time?

Please advise.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NRDP send command

Post by sreinhardt »

You can absolutely use something cron or scheduled tasks on windows to execute that. I would personally suggest using ncpa if you didn't want to manage it all manually and didn't mind an agent running on those systems. As for flags and usage, I will have to look in the morning when I am in the office. Otherwise you can always try to run it without anything and see what happens, or view the source, I seem to recall it being pretty straight forward.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: NRDP send command

Post by tariqondego »

Thanks,Cron will definately help.
below is how to use the client to send result:

Code: Select all

/usr/bin/php  /usr/local/nrdp/clients/send_nrdp.php --url=<url> --token=<token> --host=<hostname> --service=<servicename> --state=<state> --output=<output>
a couple of questions:
1.How come when I run the above command nothing happens but only displays the send_nrdp.php source code?
2.Rather than having to type in the --state and --output,i want to be able to pick the actual values of these two, from nagios for a specified host,is this possible?
3.The above syntax submits check data,what is the syntax to submit a command?

Please advise and thanks in advance.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRDP send command

Post by slansing »

Can you show us an example of your send_nrdp.php command with the data filled out, and the output? I'd be interested in seeing what you are placing in there that might be causing that.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: NRDP send command

Post by tariqondego »

Code: Select all

/usr/bin/php /usr/local/nrdp/clients/send_nrdp.php --url=http://192.168.1.5/nrdp --token=asd7fjk3l34
--host=comp1 --service=ping --state=0 --output="The service looks okay"
Same as from http://assets.nagios.com/downloads/nrdp ... erview.pdf manual

I have two instances of 4.0.7 running followed the same installation procedure on both,but strangely on inst1 its working ok and showing usage information,and when i use the full command to send to inst2,seems to be working ok.But nothing is being received on inst2.

When i run the same command on inst2 it shows the source code.
Please advise.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NRDP send command

Post by sreinhardt »

So are you sending between two core systems, sending from two systems with nrdp installed to a core, or sending between two systems with just nrdp installed? Can you post the output that you are seeing from sending on both servers?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: NRDP send command

Post by tariqondego »

Yes I am sending between two core systems with nrdp server installed on both .
Attachments
inst2.txt
(17.24 KiB) Downloaded 376 times
inst1.txt
(1.03 KiB) Downloaded 346 times
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NRDP send command

Post by lmiltchev »

Can you run the following command on 192.168.1.5 box and show us the output?

Code: Select all

grep asd7fjk3l34 /usr/local/nrdp/server/config.inc.php
Note: Modify the path to the "config.inc.php" if you need to.
Be sure to check out our Knowledgebase for helpful articles and solutions!
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: NRDP send command

Post by tariqondego »

Output:
"asd7fjk3l34",

Point is when I send the service check to 192.168.1.5,nothing gets received.
IS there a way to check for this?
send_nrdp client is on 192.168.1.5, so is it supposed to write this results someplace eg nagios.cmd?
How does it handover this information to nagios?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NRDP send command

Post by sreinhardt »

The first place to look would be the apache access and error logs, on the system receiving the results. Something like:

Code: Select all

grep -i '/nrdp' /var/log/httpd/error_log
grep -i '/nrdp' /var/log/httpd/ssl_error_log
grep -i '/nrdp' /var/log/httpd/access_log
grep -i '/nrdp' /var/log/httpd/ssl_access_log
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked