Re: Log Server Mointoring
Posted: Thu May 14, 2015 1:59 pm
Now that the linux side is done how am I to do this on the the windows side.
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
[/settings/default]
allowed hosts = 192.168.1.1/24
password = somepass
[/modules]
NSClientServer = 1
CheckSystem = 1
CheckDisk = 1
NRPEServer = 1
[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = 1
allow arguments = 1
insecure = 1
[/settings/external scripts/scripts]
check_log3 = scripts\check_log3.exe "-p somestring" "-l C:\testlog" "-c 1" --no-timeoutCode: Select all
net stop nscp
net start nscpCode: Select all
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log3
OK: Found 0 lines (limit=1/1): No matches found.|'lines'=0Navigate to Configuration -> Core Config Manager -> Services and select 'ils.cjh.org' from the dropdown. Once selected, look for the service 'Secure Log' and either delete it or change the max_attempts/check_interval/retry_interval/notification_interval values appropriately.Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'Secure Log' on host 'ils.cjh.org'
Code: Select all
su - nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.shCode: Select all
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-05-15 11:59:22-- 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”
[ <=> ] 10,831 --.-K/s in 0.01s
2015-05-15 11:59:22 (857 KB/s) - “nagiosql.login” saved [10831]
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-05-15 11:59:23-- 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”
[ <=> ] 10,831 --.-K/s in 0.02s
2015-05-15 11:59:23 (578 KB/s) - “nagiosql.login” saved [10831]
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-05-15 11:59:23-- 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”
[ <=> ] 18,257 5.90K/s in 3.0s
2015-05-15 11:59:27 (5.90 KB/s) - “nagiosql.export.monitoring” saved [18257]
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...
Warning: Duplicate definition found for service 'SQL Server' on host 'cfjh08.cfjh.net' (config file '/usr/local/nagios/etc/services/cfjh08.cfjh.net.cfg', starting on line 217)
Warning: Duplicate definition found for service 'Messages Pending Routing' on host 'cfjh16.cfjh.net' (config file '/usr/local/nagios/etc/services/cfjh16.cfjh.net.cfg', starting on line 145)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'cjh.org' (config file '/usr/local/nagios/etc/services/ajhs.org.cfg', starting on line 80)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'cfjh.net' (config file '/usr/local/nagios/etc/services/cfjh.net.cfg', starting on line 16)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'jewishcommons.org' (config file '/usr/local/nagios/etc/services/ajhs.org.cfg', starting on line 80)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'jewishwarheroes.org' (config file '/usr/local/nagios/etc/services/ajhs.org.cfg', starting on line 80)
Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'Secure Log' on host 'ils.cjh.org'
Error: Could not register service (config file '/usr/local/nagios/etc/services/Messages log.cfg', starting on line 16)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. 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 has changed.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1431634871.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1431634871.tar.gz
tar: usr/local/nagios/etc/hosts: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/hosts: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot change mode to rwxrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot change mode to rwxrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp: Cannot change mode to rwxrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/import: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/import: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/services: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/services: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/static: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/static: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: Exiting with failure status due to previous errors
/usr/local/nagiosxi/scripts
SETUID ROOT OK
RESETTING PERMS
Code: Select all
###############################################################################
#
# Hostgroup configuration file
#
# Created by: Nagios Core Config Manager 2.3.3
# Date: 2015-05-15 12:02:24
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define hostgroup {
hostgroup_name domains-expire-status
alias Domain Expiration Status
members cfjh.net,cjh.org
}
define hostgroup {
hostgroup_name linux-servers
alias Linux Servers
members ajhs.org,contributors.cjh.org,digital.cjh.org,ils.cjh.org,ilstest.cjh.org,keemu.cjh.org,search.cjh.org
}
define hostgroup {
hostgroup_name nagios-server
alias Nagios Monitoring Server
members localhost
}
define hostgroup {
hostgroup_name windows-servers
alias Windows
members cfjh.net,cfjh00.cfjh.net,cfjh08.cfjh.net,cfjh10.cfjh.net,cfjh12.cfjh.net,cfjh16.cfjh.net,cfjh50.cfjh.net,cfjh51.cfjh.net,hadassah00.cfjh.net,jewishcommons.org,jewishwarheroes.org,vm-web11.cjh.org,web09.cjh.org,web11.cjh.org,yivoserver01.cfjh.net,yivoserver02.cfjh.net
}
###############################################################################
#
# Timeperiod configuration file
#
# END OF FILE
#
###############################################################################Code: Select all
cd /usr/local/nagiosxi/scripts
bash reset_config_perms.shCode: Select all
su - nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.shCode: Select all
[root@nagiosxi-prod scripts]# bash reset_config_perms.sh
RESETTING PERMS
[root@nagiosxi-prod scripts]# su - nagios
[nagios@nagiosxi-prod ~]$ cd /usr/local/nagiosxi/scripts
[nagios@nagiosxi-prod scripts]$ ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://loca lhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'subm it=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.login--2015-05-15 13:21:44-- http://localhost/nagiosxi/includes/compon ents/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”
[ <=> ] 10,831 --.-K/s in 0.01s
2015-05-15 13:21:45 (847 KB/s) - “nagiosql.login” saved [10831]
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://loca lhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'subm it=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=n@gweb' -O nagiosql.login--2015-05-15 13:21:45-- http://localhost/nagiosxi/includes/compon ents/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”
[ <=> ] 10,831 --.-K/s in 0.005s
2015-05-15 13:21:46 (1.94 MB/s) - “nagiosql.login” saved [10831]
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-05-15 13:21:46-- 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”
[ <=> ] 18,257 4.59K/s in 3.9s
2015-05-15 13:21:50 (4.59 KB/s) - “nagiosql.export.monitoring” saved [18257]
WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributo rs
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...
Warning: Duplicate definition found for service 'SQL Server' on host 'cfjh08.cfj h.net' (config file '/usr/local/nagios/etc/services/cfjh08.cfjh.net.cfg', starti ng on line 217)
Warning: Duplicate definition found for service 'Messages Pending Routing' on ho st 'cfjh16.cfjh.net' (config file '/usr/local/nagios/etc/services/cfjh16.cfjh.ne t.cfg', starting on line 145)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'cjh .org' (config file '/usr/local/nagios/etc/services/ajhs.org.cfg', starting on li ne 80)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'cfj h.net' (config file '/usr/local/nagios/etc/services/cfjh.net.cfg', starting on l ine 16)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'jew ishcommons.org' (config file '/usr/local/nagios/etc/services/ajhs.org.cfg', star ting on line 80)
Warning: Duplicate definition found for service 'Domain Expiration' on host 'jew ishwarheroes.org' (config file '/usr/local/nagios/etc/services/ajhs.org.cfg', st arting on line 80)
Error: Invalid max_attempts, check_interval, retry_interval, or notification_int erval value for service 'Secure Log' on host 'ils.cjh.org'
Error: Could not register service (config file '/usr/local/nagios/etc/services/M essages log.cfg', starting on line 16)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. 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 has changed.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/script s
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1431634871.t ar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/14316348 71.tar.gz
tar: usr/local/nagios/etc/hosts: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/hosts: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp/pages: Cannot change mode to rwxrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot utime: Operation not permit ted
tar: usr/local/nagios/etc/pnp/check_commands: Cannot change mode to rwxrwsr-x: O peration not permitted
tar: usr/local/nagios/etc/pnp: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/pnp: Cannot change mode to rwxrwsr-x: Operation not pe rmitted
tar: usr/local/nagios/etc/import: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/import: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc/services: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/services: Cannot change mode to rwsrwsr-x: Operation n ot permitted
tar: usr/local/nagios/etc/static: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc/static: Cannot change mode to rwsrwsr-x: Operation not permitted
tar: usr/local/nagios/etc: Cannot utime: Operation not permitted
tar: usr/local/nagios/etc: Cannot change mode to rwsrwsr-x: Operation not permit ted
tar: Exiting with failure status due to previous errors
/usr/local/nagiosxi/scripts
SETUID ROOT OK
RESETTING PERMS
Code: Select all
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh