Operating System - Linux
1753492 Members
4861 Online
108794 Solutions
New Discussion

nagios - archiving is not happening with full details - Any help

 
sanwin
Frequent Advisor

nagios - archiving is not happening with full details - Any help

Hi,
In nagios server, the archiving of logs is not happening with all the details. Current nagios.log contains all notifications and service alerts. But the archived log contains only CURRENT HOST STATE alerts in the archived nagios.log.

I could not make out whether nagios.log only is getting renamed as nagios.log.april 9,2009 .

Also which file determines the type of alerts to be logged in the archive log file.

Please help me if you can.

Thanks@!!

sanwin
1 REPLY 1
Frank de Vries
Respected Contributor

Re: nagios - archiving is not happening with full details - Any help

It would help to know the verions of nagios you work with

Most likely you need to tweak your nagios.cfg

I will give a few ex



Log Rotation Method

Format: log_rotation_method=

Example: log_rotation_method=d

This is the rotation method that you would like Nagios to use for your log file. Values are as follows:

n = None (donâ t rotate the log - this is the default)

h = Hourly (rotate the log at the top of each hour)

d = Daily (rotate the log at midnight each day)

w = Weekly (rotate the log at midnight on Saturday)

m = Monthly (rotate the log at midnight on the last day of the month)

Log Archive Path

Format: log_archive_path=

Example: log_archive_path=/usr/local/nagios/var/archives/

This is the directory where Nagios should place log files that have been rotated. This option is ignored if

you choose to not use the log rotation functionality.

Notification Logging Option

Format: log_notifications=<0/1>

Example: log_notifications=1

This variable determines whether or not notification messages are logged. If you have a lot of contacts or

regular service failures your log file will grow relatively quickly. Use this option to keep contact

notifications from being logged.

0 = Donâ t log notifications

1 = Log notifications

Service Check Retry Logging Option

Format: log_service_retries=<0/1>

Example: log_service_retries=1

This variable determines whether or not service check retries are logged. Service check retries occur

when a service check results in a non-OK state, but you have configured Nagios to retry the service more

than once before responding to the error. Services in this situation are considered to be in "soft" states.

Logging service check retries is mostly useful when attempting to debug Nagios or test out service event

handlers.

0 = Donâ t log service check retries

1 = Log service check retries

Host Check Retry Logging Option

Format: log_host_retries=<0/1>

Example: log_host_retries=1

This variable determines whether or not host check retries are logged. Logging host check retries is

mostly useful when attempting to debug Nagios or test out host event handlers.

0 = Donâ t log host check retries

1 = Log host check retries

Event Handler Logging Option

Format: log_event_handlers=<0/1>

Example: log_event_handlers=1

This variable determines whether or not service and host event handlers are logged. Event handlers are

optional commands that can be run whenever a service or hosts changes state. Logging event handlers is

most useful when debugging Nagios or first trying out your event handler scripts.

0 = Donâ t log event handlers

1 = Log event handlers

Initial States Logging Option

Format: log_initial_states=<0/1>

Example: log_initial_states=1

This variable determines whether or not Nagios will force all initial host and service states to be logged,

even if they result in an OK state. Initial service and host states are normally only logged when there is a

problem on the first check. Enabling this option is useful if you are using an application that scans the

log file to determine long-term state statistics for services and hosts.

0 = Donâ t log initial states (default)

1 = Log initial states

External Command Logging Option

Format: log_external_commands=<0/1>

Example: log_external_commands=1

This variable determines whether or not Nagios will log external commands that it receives from the

external command file. Note: This option does not control whether or not passive service checks (which

are a type of external command) get logged. To enable or disable logging of passive checks, use the

log_passive_checks option.

0 = Donâ t log external commands

1 = Log external commands (default)

Passive Check Logging Option

Format: log_passive_checks=<0/1>

Example: log_passive_checks=1

This variable determines whether or not Nagios will log passive host and service checks that it receives

from the external command file. If you are setting up a distributed monitoring environment or plan on

handling a large number of passive checks on a regular basis, you may wish to disable this option so

your log file doesnâ t get too large.

0 = Donâ t log passive checks

1 = Log passive checks (default)



Look before you leap