Help with NRDS?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Help with NRDS?

Post by jbennett »

scottwilkerson wrote:is cron running on this remote machine?

Do you see any errors, and can you see it running in the cron log

Code: Select all

tail -f /var/log/cron

Code: Select all

testlane2:/etc/init.d # /etc/init.d/cron status
Checking for Cron:                                                   running
From /var/log/messages:

Code: Select all

Apr  2 10:59:42 testlane2 crontab[16032]: (root) END EDIT (nagios)
Apr  2 11:00:01 testlane2 /usr/sbin/cron[16442]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H xxx.xxx.xxx.xxx 2>&1)
Apr  2 11:00:01 testlane2 /usr/sbin/cron[16445]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2 2>&1)
Apr  2 11:01:01 testlane2 /usr/sbin/cron[16558]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H xxx.xxx.xxx.xxx 2>&1)
Apr  2 11:01:01 testlane2 /usr/sbin/cron[16561]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2 2>&1)
Apr  2 11:02:01 testlane2 /usr/sbin/cron[16658]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H xxx.xxx.xxx.xxx 2>&1)
Apr  2 11:02:01 testlane2 /usr/sbin/cron[16661]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2 2>&1)
Apr  2 11:03:01 testlane2 /usr/sbin/cron[16761]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H xxx.xxx.xxx.xxx 2>&1)
Apr  2 11:03:01 testlane2 /usr/sbin/cron[16763]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2 2>&1)
Apr  2 11:14:43 testlane2 syslog-ng[2109]: STATS: dropped 0
When I check the crontab, I see the following:

Code: Select all

*/1 * * * * /usr/local/nrdp/clients/nrds/nrds.pl -H testlane2 2>&1

*/1 * * * * /usr/local/nrdp/clients/nrds/nrds.pl -H xxx.xxx.xxx.xxx 2>&1
Just to verify, from /etc/services:

Code: Select all

http             80/tcp    # World Wide Web HTTP
http             80/udp    # World Wide Web HTTP
www              80/tcp    # World Wide Web HTTP
www              80/udp    # World Wide Web HTTP
www-http         80/tcp    # World Wide Web HTTP
www-http         80/udp    # World Wide Web HTTP
Also, I noticed that I don't have the /usr/local/nrdp/plugins folder on this machine. I do have the /usr/local/nrdp/clients folder though.

Does this help?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Help with NRDS?

Post by scottwilkerson »

This all looks correct, can you run the following from the command line

Code: Select all

/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2
jbennett wrote:Also, I noticed that I don't have the /usr/local/nrdp/plugins folder on this machine. I do have the /usr/local/nrdp/clients folder though.
this is normal, the plugins are placed in /usr/local/nagios/libexec
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Help with NRDS?

Post by jbennett »

scottwilkerson wrote:This all looks correct, can you run the following from the command line

Code: Select all

/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2
jbennett wrote:Also, I noticed that I don't have the /usr/local/nrdp/plugins folder on this machine. I do have the /usr/local/nrdp/clients folder though.
this is normal, the plugins are placed in /usr/local/nagios/libexec

Code: Select all

testlane2:/usr/local/nagios/etc # /usr/local/nrdp/clients/nrds/nrds.pl -H testlane2
ERROR: STDIN must be either 3 or 4 fields long, I found 2
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Users</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Load</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Disk</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Zombie Procs</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Total Procs</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
ERROR: The NRDP Server said BAD XML
When I go to the libexec folder, I see that the plug-ins being called are in nagios:nagios instead of all of the others which are root:root. I imagine this is correct?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Help with NRDS?

Post by scottwilkerson »

Would it be possible for you to zip up and attach the /usr/local/nrdp/clients/send_nrdp.sh off of the remote system

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Help with NRDS?

Post by scottwilkerson »

Can I have you replace your send_nrdp.sh with the one in this zip file

and then run the following again

Code: Select all

/usr/local/nrdp/clients/nrds/nrds.pl -H testlane2
If all goes well, lets also place this in the same path on your XI server any it will be used to build installers in the future
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Help with NRDS?

Post by jbennett »

I copied over the file and adjusted permissions to match the previous version of the file. I have not copied over to the Nagios server just yet.

When I ran it, I see the same results:

Code: Select all

testlane2:/usr/local/nrdp/clients # /usr/local/nrdp/clients/nrds/nrds.pl -H testlane2
ERROR: STDIN must be either 3 or 4 fields long, I found 2
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Users</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Load</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Disk</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Zombie Procs</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 221: xml+=<checkresult type='host' checktype='1'>
                    <hostname>testlane2</hostname>
                    <state>Check Total Procs</state>
                    <output>0</output>: No such file or directory
/usr/local/nrdp/clients/send_nrdp.sh: line 224: xml+=</checkresult>: No such file or directory
ERROR: The NRDP Server said BAD XML
Also, just to be sure the file I uploaded was different, I diffed them and see the change made.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Help with NRDS?

Post by scottwilkerson »

jbennett wrote:Also, just to be sure the file I uploaded was different, I diffed them and see the change made.
You did overwrite the current file right? because the output you are showing makes me believe that /usr/local/nrdp/clients/send_nrdp.sh is still the old file...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Help with NRDS?

Post by jbennett »

*sigh* I see what I did. I've fixed it now.

New output:

Code: Select all

testlane2:/usr/local/nrdp/clients # /usr/local/nrdp/clients/nrds/nrds.pl -H testlane2
ERROR: STDIN must be either 3 or 4 fields long, I found 2
Sent 5 checks to http://xxx.xxx.xxx.xxx/nrdp/
When I check Nagios though, I don't see any unconfigured objects. When I search for the hostname used in the command, I don't find the information I'm expecting. I only show a single service and it's an SSH check that's been configured to run from the Nagios box for some time now.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Help with NRDS?

Post by scottwilkerson »

This is better.

I assume http://xxx.xxx.xxx.xxx/nrdp/ is you XI server...

Also, by any chance have you implimented a RAMDisk on the XI server?

If so you will need to be sure you have your correct check_results_dir in
/usr/local/nrdp/server/config.inc.php

change

Code: Select all

$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
To something like this

Code: Select all

$cfg["check_results_dir"]="/var/nagiosramdisk/spool/checkresults";
Finally, you also are getting this

Code: Select all

ERROR: STDIN must be either 3 or 4 fields long, I found 2
which leads me to believe one of the commands is not quite right
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Help with NRDS?

Post by jbennett »

scottwilkerson wrote:This is better.

I assume http://xxx.xxx.xxx.xxx/nrdp/ is you XI server...

Also, by any chance have you implimented a RAMDisk on the XI server?

If so you will need to be sure you have your correct check_results_dir in
/usr/local/nrdp/server/config.inc.php

change

Code: Select all

$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
To something like this

Code: Select all

$cfg["check_results_dir"]="/var/nagiosramdisk/spool/checkresults";
YES! I had changed this initially when looking at the config file, but that would have been overwritten when I finally installed it correctly instead of how I was doing it. I've changed this now. Do I need to restart the NRDP server somehow?
Finally, you also are getting this

Code: Select all

ERROR: STDIN must be either 3 or 4 fields long, I found 2
which leads me to believe one of the commands is not quite right
I have only used the standard checks that are provided when you go to create a config initially since I wanted to just test this out first. These are the commands that you are referencing, correct?

Code: Select all

command[__HOST__]=/usr/local/nagios/libexec/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
command[Check Users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 
command[Check Load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[Check Disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
command[Check Zombie Procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[Check Total Procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
Locked