Page 1 of 2
Unable to see the new host From front end(GUI)
Posted: Thu Feb 28, 2019 2:10 am
by sandeep027
Hi All,
Recently i have added one new host in to nagios monitoring , but i am unable to see that host in GUI.
post configuration everything is fine and also i am able to receive alerts to my mail id ,but the only thing is i am unable to see the host in GUI.
Can any one help on this.
Re: Unable to see the new host From front end(GUI)
Posted: Thu Feb 28, 2019 5:09 pm
by scottwilkerson
Did you restart nagios after adding the config?
Are you logged in as nagiosadmin or a specific user?
Is the .cfg file you added included in the nagios.cfg?
Can you share the configuration for the host you created?
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 2:13 am
by sandeep027
Thank you for responding to my email.
Code: Select all
Did you restart nagios after adding the config?
Is restart mandatory ? After adding I just reloaded the configuration by using below command, every time i am following the same and earlier i have added almost 15 hosts in to monitoring and all are running fine. but this time not sure what happened. After adding everything is fine,MOnitoring is enabled and also i am able to receive alerts to my mail id, the only thing is i unable to see the new host in web interface.
/etc/rc.d/init.d/nagios reload
Code: Select all
Are you logged in as nagiosadmin or a specific user?
Yes i have logged into the web interface by using nagiosadmin only .
Code: Select all
Is the .cfg file you added included in the nagios.cfg?
yes
Code: Select all
Can you share the configuration for the host you created?
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name lpdvcamys01
alias lpdvcamys01
address lpdvcamys01
}
define hostgroup{
hostgroup_name dev-db-servers; The name of the hostgroup
alias Dev Servers ; Long name of the group
members irvldoedb01,irvldbbdb01,irvldmysdb01,lnpvphpa01 ; Comma separated list of hosts that belong to this group
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 2:21 am
by sandeep027
Code: Select all
Warning: Could not open object cache file '/nagiosmon/nagios/var/objects.cache' for writing!
When i verified my logs, i identified that the above warning is displayed. is this causing the problem?
when i looked for the permissions for objects.cache file, it showing as below
-rw-r--r-- 1 149 nagios 155K Dec 5 01:13 objects.cache
-rw-r--r-- 1 149 nagios 155K Dec 5 01:13 objects.precache
and for remaining it showing as below
-rw------- 1 nagios nagios 260K Feb 28 22:44 retention.dat
-rw-r--r-- 1 nagios nagios 29K Feb 28 22:44 nagios.log
-rw-rw-r-- 1 nagios nagios 259K Feb 28 23:17 status.dat
under /etc
total 68K
-rw-rwxr--+ 1 149 nagios 44K Oct 8 2014 nagios.cfg
-rw-rwxr--+ 1 149 nagios 12K Oct 8 2014 cgi.cfg
-rw-rwx---+ 1 149 nagios 1.3K Oct 8 2014 resource.cfg
-rw-rwxr--+ 1 root root 26 Oct 8 2014 htpasswd.users
drwxrwxr-x+ 2 149 nagios 4.0K Feb 27 07:51 objects
-bash-4.1$
Under objects
-rw-rwxr--+ 1 149 nagios 3.6K Jan 2 22:44 timeperiods.cfg
-rw-rwxr--+ 1 149 nagios 2.8K Feb 4 20:42 contacts.cfg
-rw-rwxr--+ 1 149 nagios 24K Feb 27 07:44 localhost.cfg
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 7:36 am
by scottwilkerson
sandeep027 wrote:Code: Select all
Warning: Could not open object cache file '/nagiosmon/nagios/var/objects.cache' for writing!
this certainly would be problematic however the permissions you showed didn't sow both user and group
I would try restarting nagios which should re-create this file
If you continue to have problems please show the following
Code: Select all
ls -al /nagiosmon/nagios/var/objects.cache
ls -ld /nagiosmon/nagios/var
ls -ld /nagiosmon/nagios
ls -ld /nagiosmon
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 8:08 am
by sandeep027
Code: Select all
this certainly would be problematic however the permissions you showed didn't sow both user and group
Please find the user and group as below, 149 and nagios
-rw-r--r-- 1 149 nagios 158707 Dec 5 01:13 /nagiosmon/nagios/var/objects.cache
and i have restarted the Nagios by using /etc/rc.d/init.d/nagios restart ,still same problem
Please find the permissions as below for the
-bash-4.1$ ls -al /nagiosmon/nagios/var/objects.cache
-rw-r--r-- 1 149 nagios 158707 Dec 5 01:13 /nagiosmon/nagios/var/objects.cache
-bash-4.1$ ls -ld /nagiosmon/nagios/var
drwxrwxr-x+ 5 149 nagios 4096 Mar 1 04:44 /nagiosmon/nagios/var
-bash-4.1$ ls -ld /nagiosmon/nagios
drwxr-xr-x 9 smsqlp01 users 4096 Oct 8 2014 /nagiosmon/nagios
-bash-4.1$ ls -ld /nagiosmon
drwxr-xr-x 8 smsqlp01 users 4096 Oct 23 2014 /nagiosmon
can you please check and help on this.
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 8:24 am
by scottwilkerson
For some reason the user is set to 149 not the group, and I see this file hasn't been updated in months.
Lets run the following
Code: Select all
chown nagios.nagios -R /nagiosmon/nagios/var
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 9:12 am
by sandeep027
Code: Select all
chown nagios.nagios -R /nagiosmon/nagios/var
if we run this , we didn't face any problem right ? why because i am not familiar with these unix gorup and users.
and also for the below one's also we have same 149 and nagios permissions ,and up to now everything is fine. if we change to nagios nagios it won't be any problem right?
-rw-rwxr--+ 1 149 nagios 3.6K Jan 2 22:44 timeperiods.cfg
-rw-rwxr--+ 1 149 nagios 2.8K Feb 4 20:42 contacts.cfg
-rw-rwxr--+ 1 149 nagios 24K Mar 1 05:02 localhost.cfg
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 9:16 am
by scottwilkerson
No it won't be a problem and should be how the permissions should be set.
Re: Unable to see the new host From front end(GUI)
Posted: Fri Mar 01, 2019 9:23 am
by sandeep027
Thank you for quick update. Let me try.