General config issues for Nagios3 Rashberry PI

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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: General config issues for Nagios3 Rashberry PI

Post by Box293 »

From your Nagios Pi, execute these commands and post back the results:

Code: Select all

/usr/lib/nagios/plugins/check_nt -H xxx -p 12489 -v CLIENTVERSION

/usr/lib/nagios/plugins/check_nt -H xxx -p 12489 -v UPTIME
Where xxx is the IP Address of the machine running NSClient++
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: General config issues for Nagios3 Rashberry PI

Post by nathanplatt »

Results

pi@raspberrypi ~ $ /usr/lib/nagios/plugins/check_nt -H 192.168.87.83 -p 12489 -v CLIENTVERSION

pi@raspberrypi ~ $ /usr/lib/nagios/plugins/check_nt -H 192.168.87.83 -p 12489 -v UPTIME
could not fetch information from server
pi@raspberrypi ~ $

The first one didn't give me anything... could this be a port issue, our firewalls are very closed, i've requested the ports to be open but maybe that hasn't been done. Can I test the port from Nagios?

Nathan
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: General config issues for Nagios3 Rashberry PI

Post by nathanplatt »

I've moved my test to a server that won't be affected by a firewall and I'm getting the same issue. Any ideas?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: General config issues for Nagios3 Rashberry PI

Post by tgriep »

Run the following from the Nagios system to see if the port is open. You will need to have nmap installed on it.
Replace xxx.xxx.xxx.xxx with the IP address of your windows system.

Code: Select all

nmap -p 12489 xxx.xxx.xxx.xxx
Also, could you post your latest nsclient.ini file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: General config issues for Nagios3 Rashberry PI

Post by nathanplatt »

pi@raspberrypi ~ $ nmap -p 12489 192.168.1.166

Starting Nmap 6.00 ( http://nmap.org ) at 2015-05-12 05:47 UTC
Nmap scan report for 192.168.1.166
Host is up (0.00075s latency).
PORT STATE SERVICE
12489/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds
pi@raspberrypi ~ $

nsclient.ini

[/settings/default]
allowed hosts = 192.168.1.11/255.255.255.0
password = N0rth3dgE!

[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1

[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = 1
allow arguments = 1
insecure = 1
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: General config issues for Nagios3 Rashberry PI

Post by Box293 »

Great I think we've found the source of your problem and there are two problems.

First, change your allowed hosts to this:

Code: Select all

allowed hosts = 192.168.1.11
If you wanted to allow a whole class C network then you would do this:

Code: Select all

allowed hosts = 192.168.1.0/24
After making that change and restarting the NSClient++ service you should be able to run this on the Nagios host:

Code: Select all

/usr/lib/nagios/plugins/check_nt -H 192.168.87.83 -p 12489 -s 'N0rth3dgE!' -v CLIENTVERSION
Which should return something like:

Code: Select all

NSClient++ 0.4.3.143 2015-04-29
Now the second problem you have is with your password. The ! mark in the password will cause nagios to break, as nagios command directives use the ! to separate arguments.

Just change it in your nsclient.ini file and restart the service.

Then your command definition would be something like:

Code: Select all

define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s $ARG1$ -v $ARG2$ $ARG3$
}
Then your service definition would contain the line:

Code: Select all

check_command check_nt!the_password_whatever_it_is!UPTIME
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: General config issues for Nagios3 Rashberry PI

Post by nathanplatt »

I made all those changes and I'm still getting errors, same as before no response from server. I've had a nightmare install of this as its running on a raspberry PI using the apt-get install Nagios3 and then manually installing the plugins.

Any other advice?
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: General config issues for Nagios3 Rashberry PI

Post by nathanplatt »

Correction... that has worked! Will I be able to use this for CPU monitoring and Disk space etc?

Thank you for all the help!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: General config issues for Nagios3 Rashberry PI

Post by jdalrymple »

nathanplatt wrote:Correction... that has worked! Will I be able to use this for CPU monitoring and Disk space etc?

Thank you for all the help!
Yes. To get a basic understanding check out this:

Code: Select all

/usr/lib/nagios/plugins/check_nt --help
If you need further help with this please open a new topic. I think the problem that this thread was opened for is now solved and we should lock it. Is that OK?
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: General config issues for Nagios3 Rashberry PI

Post by nathanplatt »

Yes, solved, thank you
Locked