Log Server Mointoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

Now that the linux side is done how am I to do this on the the windows side.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

On the Windows side, I've tested this using check_log3.exe instead of check_log3.pl. Check_log3.exe can be downloaded here: http://sourceforge.net/projects/pma-oss ... s-plugins/

You will need to have NSClient running on your Windows Servers. You can download NSClient here: http://www.nsclient.org/download/

Once downloaded, you'll need to adjust nsclient.ini - I used the following configuration:

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-timeout
Then restart NSclient on the windows box with an administrative cmd prompt:

Code: Select all

net stop nscp
net start nscp
Once it's restarted, you can call the Windows machine in much the same way you'd call a linux box:

Code: 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'=0
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

So I am doing this on a different server now everything works but I deleted a service but now cant apply.

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Configuration file: ils.cjh.org.cfg successfully written!
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
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)
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'Secure Log' on host 'ils.cjh.org'
Navigate to Configuration -> Core Config Manager -> Services and select 'ils.cjh.org' from the dropdown.
2015-05-14 15_58_36-Nagios XI - Nagios Core Config Manager.png
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.
You do not have the required permissions to view the files attached to this post.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

The thing is I already deleted it so nothing comes up with that name.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

Please access 'Configure -> Core Config Manager -> Write Config Files' and click the following buttons one at a time:
Delete
Write
Verify
Restart

Let us know if you get any useful output. If not, please log into the CLI and try the following:

Code: Select all

su - nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Best,


Jesse
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

RESTART FAILED. CONFIG ERROR:
Error: Could not find any host matching 'cfjh.net' (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 34)
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 34)

Code: 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

/usr/local/nagios/etc/hostgroups.cfg

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
#
###############################################################################
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

There might be some permission problems. Let's try and fix those. Please log into your CLI as root and run the following:

Code: Select all

cd /usr/local/nagiosxi/scripts
bash reset_config_perms.sh
After you have completed the above, try re-running our previous test:

Code: Select all

su - nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

Still same issue.


Code: 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Log Server Mointoring

Post by ssax »

Try running this as root and post the full output:

Code: Select all

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