Page 2 of 3

Re: No shoes, no shirt, no services...

Posted: Tue Jan 06, 2015 5:46 pm
by lmiltchev
Can you see all of the hosts/services in the CCM? What is the output of the following commands?

Code: Select all

echo 'select count(*) from nagios_hosts;' | mysql -s -pnagiosxi nagios
echo 'select count(*) from nagios_services;' | mysql -s -pnagiosxi nagios

Re: No shoes, no shirt, no services...

Posted: Wed Jan 07, 2015 7:35 am
by wyoder
Good call.

There appears to be a discrepancy between the MySQL queries from the command line and the Web queries from the UI.

CLI results:

Code: Select all

[root@nagios02 ~]# echo 'select count(*) from nagios_hosts;' | mysql -s -pnagiosxi nagios
0
[root@nagios02 ~]# echo 'select count(*) from nagios_services;' | mysql -s -pnagiosxi nagios
0
UI Host results from the CCM:

Code: Select all


	 Host Name	 Alias	 Active	 Status	Actions	 ID
	exportrh-00.nnnn.net		Yes	Applied	EditCopyDownloadInfoDelete	2
	jenkinsrh-01.nnnn.net		Yes	Applied	EditCopyDownloadInfoDelete	4
	krouth03dvl.nnnn.net		Yes	Applied	EditCopyDownloadInfoDelete	3
	localhost	localhost	Yes	Applied	EditCopyDownloadInfoDelete	1
	ralwin7-03.nnnn.net		Yes	Applied	EditCopyDownloadInfoDelete	5

UI Service results from the CCM:

Code: Select all

         Config Name	 Service Description	 Active	 Status	Actions	 ID
	exportrh-00.nnnn.net	HTTP	Yes	Applied	EditCopyDownloadInfoDelete	11
	exportrh-00.nnnn.net	Ping	Yes	Applied	EditCopyDownloadInfoDelete	9
	exportrh-00.nnnn.net	SSH	Yes	Applied	EditCopyDownloadInfoDelete	10
	exportrh-00.nnnn.net	TCP Port 111 - sunrpc	Yes	Applied	EditCopyDownloadInfoDelete	12
	jenkinsrh-01.nnnn.net	/ Disk Usage	Yes	Applied	EditCopyDownloadInfoDelete	26
	jenkinsrh-01.nnnn.net	Apache Web Server	Yes	Applied	EditCopyDownloadInfoDelete	29
	jenkinsrh-01.nnnn.net	CPU Stats	Yes	Applied	EditCopyDownloadInfoDelete	20
Obviously, I'm clueless regarding this discrepancy.

Note: I ran this repair command as well:

Code: Select all

# /usr/local/nagiosxi/scripts/repairmysql.sh nagios
However, the above results stayed the same.

Thanks!
--Bill

Re: No shoes, no shirt, no services...

Posted: Wed Jan 07, 2015 6:07 pm
by abrist
Hmmm, it looks like those tables are empty?
Do you have any query errors in the system messages by chance?

Code: Select all

grep query /var/log/messages

Re: No shoes, no shirt, no services...

Posted: Wed Jan 07, 2015 6:10 pm
by lmiltchev
Also, run the "reconfigure_nagios.sh" from the CLI and show us the output in code wraps. Thanks!

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh

Re: No shoes, no shirt, no services...

Posted: Thu Jan 08, 2015 8:39 am
by wyoder
Hello, abrist and lmiltchev:

You are right--the MySQL nagios_hosts and nagios_services tables are empty. Nada, nothing, zip in them. We added a couple more Linux hosts using the "Linux Server" Wizard yesterday with the same results.

Here is output from the /var/log/messages query:

Code: Select all

[root@nagios02 ~]# grep query /var/log/messages
Jan  5 07:28:20 nagios02 nagios: qh: core query handler registered
Jan  5 07:28:20 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  5 07:35:03 nagios02 nagios: qh: core query handler registered
Jan  5 07:35:03 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  5 07:37:32 nagios02 nagios: qh: core query handler registered
Jan  5 07:37:32 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  5 07:44:36 nagios02 nagios: qh: core query handler registered
Jan  5 07:44:36 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  6 09:49:17 nagios02 nagios: qh: core query handler registered
Jan  6 09:49:17 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  6 09:49:21 nagios02 nagios: qh: core query handler registered
Jan  6 09:49:21 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  6 09:58:18 nagios02 nagios: qh: core query handler registered
Jan  6 09:58:18 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  6 11:07:13 nagios02 nagios: qh: core query handler registered
Jan  6 11:07:13 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  6 13:35:15 nagios02 kernel: ACPI: BIOS _OSI(Linux) query ignored
Jan  6 13:35:23 nagios02 nagios: qh: core query handler registered
Jan  6 13:35:23 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  6 13:53:04 nagios02 nagios: qh: core query handler registered
Jan  6 13:53:04 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  7 10:40:19 nagios02 nagios: qh: core query handler registered
Jan  7 10:40:19 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  7 10:41:58 nagios02 nagios: qh: core query handler registered
Jan  7 10:41:58 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
Jan  7 10:43:46 nagios02 nagios: qh: core query handler registered
Jan  7 10:43:46 nagios02 nagios: wproc: Successfully registered manager as @wproc with query handler
And here are the results from the reconfigure command:

Code: Select all

[root@nagios02 scripts]# ./reconfigure_nagios.sh 
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.login--2015-01-08 07:20:08--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

    [ <=>                                                                                                                    ] 11,276      --.-K/s   in 0.01s   

2015-01-08 07:20:08 (975 KB/s) - “nagiosql.login” saved [11276]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
SETUID ROOT OK
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.login--2015-01-08 07:20:08--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

    [ <=>                                                                                                                    ] 11,276      --.-K/s   in 0.008s  

2015-01-08 07:20:08 (1.27 MB/s) - “nagiosql.login” saved [11276]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-01-08 07:20:09--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”

    [  <=>                                                                                                                   ] 14,130      45.6K/s   in 0.3s    

2015-01-08 07:20:09 (45.6 KB/s) - “nagiosql.export.monitoring” saved [14130]

WRITE CONFIGS SUCCESSFUL!
OUTPUT: 
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 8 services.
        Checked 1 hosts.
        Checked 1 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 1 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios: done.
Starting nagios: done.
Thanks as always for your help.
--Bill

Re: No shoes, no shirt, no services...

Posted: Thu Jan 08, 2015 3:33 pm
by lmiltchev
Could you check if you have:

Code: Select all

User_Alias      NAGIOSXI=nagios
defined in two places - in sudoers and another file in "/etc/sudoers.d/" directory?

Also, run the following command to begin capturing log output:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log &> /tmp/cmd.txt
Attempt to Apply Configuration from the web interface. After the browser has returned some output to the screen, press Ctrl+C to stop the log tail, and post the cmd.txt file that was generated in the "/tmp/" directory by the above instructions.

Re: No shoes, no shirt, no services...

Posted: Thu Jan 08, 2015 4:15 pm
by wyoder
Hi, lmiltchev:

NAGIOSXI is defined in /etc/sudoers, but NOT in the other place:

Code: Select all

[root@nagios02 sudoers.d]# pwd
/etc/sudoers.d
[root@nagios02 sudoers.d]# ls -alR
.:
total 16
drwxr-x---.   2 root root  4096 Jul 31 07:05 .
drwxr-xr-x. 135 root root 12288 Jan  8 15:52 ..
And here is output captured from pressing the "Apply Configuration" button:

Code: Select all

# cat /tmp/cmd.txt 
..................
PROCESSED 0 COMMANDS
ing new htaccess credentials
Updating password for user wyoder
OUTPUT=
RETURNCODE=0
.........
PROCESSED 1 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
................PROCESSING COMMAND ID 81...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-01-08 15:54:17--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

     0K .......... .                                            892K=0.01s

2015-01-08 15:54:17 (892 KB/s) - “nagiosql.login” saved [11276]

/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
SETUID ROOT OK
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-01-08 15:54:18--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

     0K .......... .                                           1.20M=0.009s

2015-01-08 15:54:18 (1.20 MB/s) - “nagiosql.login” saved [11276]

/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.loginLOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-01-08 15:54:18--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”

     0K .......... ...                                         47.1K=0.3s

2015-01-08 15:54:19 (47.1 KB/s) - “nagiosql.export.monitoring” saved [14130]

WRITE CONFIGS SUCCESSFUL!
OUTPUT: 
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
        Checked 8 services.
        Checked 1 hosts.
        Checked 1 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 1 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios: done.
Starting nagios: done.
OUTPUT=Starting nagios: done.
RETURNCODE=0
..................
Note: I didn't do anything other than logging in and hitting the button. Is this helpful?

Thanks much,
--Bill

Re: No shoes, no shirt, no services...

Posted: Fri Jan 09, 2015 2:58 pm
by lmiltchev
Can you PM me your profile? We will need to take a look at the configs and log files.

Admin->System Profile->Download Profile->save "profile.zip"

Re: No shoes, no shirt, no services...

Posted: Tue Jan 13, 2015 11:53 am
by lmiltchev
I looked at the profile you PM-ed me and noticed that you are running Gnome on this box... We support Nagios XI instances installed on a "clean" system (a bare minimal install with nothing else installed or configured).

http://support.nagios.com/wiki/index.ph ... requisites

I would recommend reinstalling on a clean system (minimum install) if this is an option for you. Otherwise, we can try troubleshooting this system.

Can you run the following commands and show us the output in code wraps?

Code: Select all

tail -50 /var/log/cron
getenforce
chage -l nagios
chage -l apache
echo $PATH

Re: No shoes, no shirt, no services...

Posted: Tue Jan 13, 2015 3:32 pm
by wyoder
You've convinced me to start over.

The easiest path obviously would be to install one of your pre-built VMs, but they're CentOS-based, which is fine, except that we're on a Red Hat support contract and want to keep our production Nagios XI server in scope.

I'll start with a RHEL 6.5 ISO and select as few packages as possible. After a couple days, we'll let you know how things turn out.

Thanks,
--Bill