Code: Select all
echo 'select count(*) from nagios_hosts;' | mysql -s -pnagiosxi nagios
echo 'select count(*) from nagios_services;' | mysql -s -pnagiosxi nagiosCode: Select all
echo 'select count(*) from nagios_hosts;' | mysql -s -pnagiosxi nagios
echo 'select count(*) from nagios_services;' | mysql -s -pnagiosxi nagiosCode: 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
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
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
Code: Select all
# /usr/local/nagiosxi/scripts/repairmysql.sh nagios
Code: Select all
grep query /var/log/messagesCode: Select all
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
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
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.
Code: Select all
User_Alias NAGIOSXI=nagiosCode: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log &> /tmp/cmd.txtCode: 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 ..
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
..................
Code: Select all
tail -50 /var/log/cron
getenforce
chage -l nagios
chage -l apache
echo $PATH