Monitored host not displaying
Monitored host not displaying
Hi all,
I'm brand new to this so please excuse my ignorance.
I have built an Ubuntu Server 17.04 on one of our Hyper-V hosts onto which I then loaded Nagios Core 4.3.2 following the step by step guide on the Nagios support pages (https://support.nagios.com/kb/article/n ... tml#Ubuntu)
I then installed the NCPA 2.0.5 onto a brand new Windows Server 2008 R2 machine that I built last week to use as a web server. To install the NCPA I again used the guide on the Nagios support pages (https://www.nagios.org/ncpa/getting-started.php)
I've created my commands.cfg and ncpa.cfg files as outlined in the guide the only thing I wasn't too sure about was when creating the commands.cfg file I entered this info:
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
I substituted $USER1$ for the username on my Nagios - in this instance administrator, the $HOSTADDRESS$ I put the IP Address of the Windows server I wanted to monitor however I didn't know what I had to put for $ARG1$ so i've left it as that. So mine looks like this:
define command {
command_name check_ncpa
command_line $administrator$/check_ncpa.py -H $192.168.1.1$ $ARG1$
}
I don't know what i'm doing wrong as i've literally followed the guide to the letter but when I go to my Nagios URL and look at hosts & host groups it is still only listing the localhost.
I've checked the firewall on the Windows Server and port 5693 is allowed all traffic, i've checked my token is correct. I've even uninstall the NCPA and started again.
Can anyone offer any advice?
Thanks
Karl
I'm brand new to this so please excuse my ignorance.
I have built an Ubuntu Server 17.04 on one of our Hyper-V hosts onto which I then loaded Nagios Core 4.3.2 following the step by step guide on the Nagios support pages (https://support.nagios.com/kb/article/n ... tml#Ubuntu)
I then installed the NCPA 2.0.5 onto a brand new Windows Server 2008 R2 machine that I built last week to use as a web server. To install the NCPA I again used the guide on the Nagios support pages (https://www.nagios.org/ncpa/getting-started.php)
I've created my commands.cfg and ncpa.cfg files as outlined in the guide the only thing I wasn't too sure about was when creating the commands.cfg file I entered this info:
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
I substituted $USER1$ for the username on my Nagios - in this instance administrator, the $HOSTADDRESS$ I put the IP Address of the Windows server I wanted to monitor however I didn't know what I had to put for $ARG1$ so i've left it as that. So mine looks like this:
define command {
command_name check_ncpa
command_line $administrator$/check_ncpa.py -H $192.168.1.1$ $ARG1$
}
I don't know what i'm doing wrong as i've literally followed the guide to the letter but when I go to my Nagios URL and look at hosts & host groups it is still only listing the localhost.
I've checked the firewall on the Windows Server and port 5693 is allowed all traffic, i've checked my token is correct. I've even uninstall the NCPA and started again.
Can anyone offer any advice?
Thanks
Karl
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitored host not displaying
Have you imported your ncpa.cfg file into the nagios.cfg file?
And the commands.cfg file should allready exist in the objects folder. Can you paste your commands inside that file?
After that please run in the command line.
Code: Select all
cfg_file=/usr/local/nagios/etc/ncpa.cfg
Code: Select all
/usr/localnagios/etc/objects
Code: Select all
service nagios restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitored host not displaying
Morning,
Thanks for the info. I have followed your steps and when I try to start the nagios service again I get this error saying that it failed to start the service with this reason:
Check your configuration file(s) to ensure that they contain valid directives and data definitions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section to find out what's changed
All i've done is ran that first command you supplied
And then moved the commands.cfg from and moved it to using
Thanks for the info. I have followed your steps and when I try to start the nagios service again I get this error saying that it failed to start the service with this reason:
Check your configuration file(s) to ensure that they contain valid directives and data definitions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section to find out what's changed
All i've done is ran that first command you supplied
Code: Select all
cfg_file=/usr/local/nagios/etc/ncpa.cfg
Code: Select all
/usr/local/nagios/etc
Code: Select all
/usr/local/nagios/etc/objects
Code: Select all
sudo mv
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitored host not displaying
Hi,@karl. Can you upload your nagios.cfg, ncpa.cfg and commands.cfg files here? Also, please run the following command and show us the output:
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitored host not displaying
Hiya,
I can't seem to copy and paste so instead I've taken screenshots I hope it comes out OK. For security I've blanked out any IP addresses or passwords.
The forum will only allow me to upload a max of 20 URL's and unfortunately there are a few more than that so instead I have uploaded them to my file sharing account and can be viewed on this link (i'd suggest sorting them by name as it's uploaded them in reverse!):
https://app.box.com/s/pj7vqp9bgiti3zlzo22cnygmf7dgsbdl
Below is the result from the command you asked me to run:
Any problems please let me know, i'm in the office today (Friday 13th) then out until Tuesday 17th however if you reply i'll get an e-mail and I can check it.
Thanks again for all your help
I can't seem to copy and paste so instead I've taken screenshots I hope it comes out OK. For security I've blanked out any IP addresses or passwords.
The forum will only allow me to upload a max of 20 URL's and unfortunately there are a few more than that so instead I have uploaded them to my file sharing account and can be viewed on this link (i'd suggest sorting them by name as it's uploaded them in reverse!):
https://app.box.com/s/pj7vqp9bgiti3zlzo22cnygmf7dgsbdl
Below is the result from the command you asked me to run:
Any problems please let me know, i'm in the office today (Friday 13th) then out until Tuesday 17th however if you reply i'll get an e-mail and I can check it.
Thanks again for all your help
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitored host not displaying
Hi, @karl. Thanks for the screenshots. Can you put this line inside your nagios.cfg file(as on the screenshot)
After that try restarting nagios one more time and see if you get any errors.
Let us know how it goes.
Code: Select all
cfg_file=/usr/local/nagios/etc/ncpa.cfg
Code: Select all
service nagios restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitored host not displaying
Hiya,
Added as suggested.
When I tried to restart I got this:
So I ran again and got this:
Added as suggested.
When I tried to restart I got this:
So I ran
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitored host not displaying
@ karl, As far as this command from your first post: You din't need to change it at all. Basically, $USER1$ is Macro that will get automatically replaced by Nagios to point to /usr/local/nagios/libexec folder on your machine. That's the folder where you have all Nagios plugins, including check_ncpa.py
$HOSTADDRESS$ is the host's IP address that will get automatically taken from the host definition. And $ARG1$ corresponds to any arguments that will be passed to the check_ncpa.py in the future. You should change that back to what it was.
After that try to restart your Nagios server again.
If that doesn't help please upload here or you can pm me the whole /usr/local/nagios/etc/ folder. I highly recommend using WinSCP or Filezilla for that. Then put the whole /usr/local/nagios/etc/ folder in a ZIP archive and send it.
Code: Select all
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
$HOSTADDRESS$ is the host's IP address that will get automatically taken from the host definition. And $ARG1$ corresponds to any arguments that will be passed to the check_ncpa.py in the future. You should change that back to what it was.
Code: Select all
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macros.html
If that doesn't help please upload here or you can pm me the whole /usr/local/nagios/etc/ folder. I highly recommend using WinSCP or Filezilla for that.
Code: Select all
https://winscp.net/eng/download.php
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Monitored host not displaying
@karl, I received your files. Seems like when you were adding check_ncpa command in /usr/local/nagios/etc/objects/commands.cfg , you deleted all the standard commands for localhost services, defined in localhost.cfg.
I attached the commands.cfg file that includes all the commands for localhost. Go ahead and replace your commands.cfg file. After that restart nagios server. Let us know how it goes.
I attached the commands.cfg file that includes all the commands for localhost. Go ahead and replace your commands.cfg file. After that restart nagios server. Let us know how it goes.
- Attachments
-
- commands.cfg
- (7.61 KiB) Downloaded 572 times
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitored host not displaying
Hiya,
Thanks for all your help. I've got the commands file uploaded and the service restarted with no errors.
I have the NCPA installed on a windows server and that's now displaying under hosts which is great! Only problem is it's displaying a new error now:
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: /usr/bin/env: ‘python’: No such file or directory))
I know you're probably fed up of helping a novice like me, i'd like to now add our routers at each site to monitor for outages what's the easiest way of doing this?
Thanks again
Thanks for all your help. I've got the commands file uploaded and the service restarted with no errors.
I have the NCPA installed on a windows server and that's now displaying under hosts which is great! Only problem is it's displaying a new error now:
(Return code of 127 is out of bounds - plugin may be missing : (No output on stdout) stderr: /usr/bin/env: ‘python’: No such file or directory))
I know you're probably fed up of helping a novice like me, i'd like to now add our routers at each site to monitor for outages what's the easiest way of doing this?
Thanks again