Basics - Adding a Host to Nagios Core

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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Basics - Adding a Host to Nagios Core

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
workid
Posts: 34
Joined: Wed Oct 10, 2018 7:28 am

Re: Basics - Adding a Host to Nagios Core

Post 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.
Attachments
objects.cfg
(20.46 KiB) Downloaded 299 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Basics - Adding a Host to Nagios Core

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
workid
Posts: 34
Joined: Wed Oct 10, 2018 7:28 am

Re: Basics - Adding a Host to Nagios Core

Post 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:~$ 
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Basics - Adding a Host to Nagios Core

Post 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?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
workid
Posts: 34
Joined: Wed Oct 10, 2018 7:28 am

Re: Basics - Adding a Host to Nagios Core

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Basics - Adding a Host to Nagios Core

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
workid
Posts: 34
Joined: Wed Oct 10, 2018 7:28 am

Re: Basics - Adding a Host to Nagios Core

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Basics - Adding a Host to Nagios Core

Post 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!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked