Page 4 of 4

Re: Basics - Adding a Host to Nagios Core

Posted: Wed Oct 17, 2018 9:47 am
by scottwilkerson
This is quite strange that you are seeing Return code of 127 is out of bounds. Check if plugin exists for this host
Please post the output of the following

Code: Select all

cat /usr/local/nagios/etc/resource.cfg
and attached the var/objects.cache from the nagios directory

Re: Basics - Adding a Host to Nagios Core

Posted: Mon Oct 22, 2018 7:16 am
by workid
Here is the output:

Code: Select all

# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/nagios/libexec

# Sets $USER2$ to be the path to event handlers
#$USER2$=/usr/local/nagios/libexec/eventhandlers

# Store some usernames and passwords (hidden from the CGIs)
#$USER3$=someuser
#$USER4$=somepassword
and i have attached the objects.cache file, it would not let me attach it at first as the site said it was unable to add file with a .cache extension, so i have renamed it objects.cfg so that i could attach it to this post. you should be able to just rename it back.

Re: Basics - Adding a Host to Nagios Core

Posted: Mon Oct 22, 2018 12:43 pm
by scottwilkerson
This all looks normal. The only thing I can think is that your check_ncpa.py has a different path to python that exists on your server.

Can you run the following commands

Code: Select all

head -1 /usr/local/nagios/libexec/check_ncpa.py
which python

Re: Basics - Adding a Host to Nagios Core

Posted: Wed Oct 24, 2018 8:21 am
by workid
Here you go...

Code: Select all

admin-it@GC-NAGIOS:~$ head -1 /usr/local/nagios/libexec/check_ncpa.py
#!/usr/bin/env python
admin-it@GC-NAGIOS:~$ which python
admin-it@GC-NAGIOS:~$ 

Re: Basics - Adding a Host to Nagios Core

Posted: Wed Oct 24, 2018 3:41 pm
by scottwilkerson
workid wrote:

Code: Select all

admin-it@GC-NAGIOS:~$ which python
This looks like python is not installed. What OS are you using?

Re: Basics - Adding a Host to Nagios Core

Posted: Thu Oct 25, 2018 8:19 am
by workid
Ubuntu

Yeah i wasn't sure if it was by looking at that, i installed Nagios following the quick guides, i had a quick google and didn't find a guide to install with Nagios so i assumed that python was installed as part the Nagios install originally.

Do i need to install Python separately?

Re: Basics - Adding a Host to Nagios Core

Posted: Thu Oct 25, 2018 3:29 pm
by scottwilkerson
Python isn't part of Nagios, but is installed on most Linux systems, but you don't seem to have it.

you should be able to install with something like

Code: Select all

apt-get install python

Re: Basics - Adding a Host to Nagios Core

Posted: Mon Oct 29, 2018 8:35 am
by workid
Installed Python and its now all working! 8-)

Many thanks for your help with this and putting up with my lack of knowledge, learnt quite a bit just from going through this with you.

Re: Basics - Adding a Host to Nagios Core

Posted: Mon Oct 29, 2018 9:05 am
by scottwilkerson
workid wrote:Installed Python and its now all working! 8-)

Many thanks for your help with this and putting up with my lack of knowledge, learnt quite a bit just from going through this with you.
Great Locking!