Page 1 of 1

Nagiosxi DB size or rotate for log file

Posted: Wed Jul 08, 2015 4:23 am
by michaelli
Hi support,

I would like to clarify the Admin->System config->performance settings->Databases->Max Log Entries Age:

Now the setting is 90 days. Does it mean it will keep all hosts eg. system log, application log for both active and passive for 90 days?
Kindly refer to attached picture.

Below table show the file under /var/lib/mysql/nagios. Now we can observe the nagios_logentries.MYD grow to 183M. Does this file store the all hosts logs and does it control the logrotate by "Max Log Entries Age" which I mention above.

Code: Select all

4.0K    db.opt
183M    nagios_logentries.MYD
97M     nagios_logentries.MYI
12K     nagios_acknowledgements.frm
16K     nagios_acknowledgements.MYD
8.0K    nagios_acknowledgements.MYI
12K     nagios_commands.frm
12K     nagios_commands.MYD
8.0K    nagios_commands.MYI
12K     nagios_commenthistory.frm
704K    nagios_commenthistory.MYD
72K     nagios_commenthistory.MYI
12K     nagios_comments.frm
4.0K    nagios_comments.MYD
4.0K    nagios_comments.MYI
12K     nagios_configfiles.frm
4.0K    nagios_configfiles.MYD
8.0K    nagios_configfiles.MYI
12K     nagios_configfilevariables.frm
8.0K    nagios_configfilevariables.MYD
4.0K    nagios_configfilevariables.MYI
12K     nagios_conninfo.frm
132K    nagios_conninfo.MYD
20K     nagios_conninfo.MYI
12K     nagios_contact_addresses.frm
0       nagios_contact_addresses.MYD
4.0K    nagios_contact_addresses.MYI
12K     nagios_contactgroup_members.frm
4.0K    nagios_contactgroup_members.MYD
4.0K    nagios_contactgroup_members.MYI
12K     nagios_contactgroups.frm
4.0K    nagios_contactgroups.MYD
4.0K    nagios_contactgroups.MYI
12K     nagios_contact_notificationcommands.frm
8.0K    nagios_contact_notificationcommands.MYD
8.0K    nagios_contact_notificationcommands.MYI
12K     nagios_contactnotificationmethods.frm
15M     nagios_contactnotificationmethods.MYD
15M     nagios_contactnotificationmethods.MYI
12K     nagios_contactnotifications.frm
13M     nagios_contactnotifications.MYD
24M     nagios_contactnotifications.MYI
12K     nagios_contacts.frm
4.0K    nagios_contacts.MYD
4.0K    nagios_contacts.MYI
12K     nagios_contactstatus.frm
4.0K    nagios_contactstatus.MYD
4.0K    nagios_contactstatus.MYI
12K     nagios_customvariables.frm
68K     nagios_customvariables.MYD
64K     nagios_customvariables.MYI
12K     nagios_customvariablestatus.frm
80K     nagios_customvariablestatus.MYD
64K     nagios_customvariablestatus.MYI
12K     nagios_dbversion.frm
4.0K    nagios_dbversion.MYD
4.0K    nagios_dbversion.MYI
12K     nagios_downtimehistory.frm
0       nagios_downtimehistory.MYD
4.0K    nagios_downtimehistory.MYI
12K     nagios_eventhandlers.frm
12K     nagios_eventhandlers.MYD
4.0K    nagios_eventhandlers.MYI
12K     nagios_externalcommands.frm
60M     nagios_externalcommands.MYD
5.0M    nagios_externalcommands.MYI
12K     nagios_flappinghistory.frm
272K    nagios_flappinghistory.MYD
44K     nagios_flappinghistory.MYI
12K     nagios_hostchecks.frm
0       nagios_hostchecks.MYD
4.0K    nagios_hostchecks.MYI
12K     nagios_host_contactgroups.frm
4.0K    nagios_host_contactgroups.MYD
4.0K    nagios_host_contactgroups.MYI
12K     nagios_host_contacts.frm
4.0K    nagios_host_contacts.MYD
8.0K    nagios_host_contacts.MYI
12K     nagios_hostdependencies.frm
0       nagios_hostdependencies.MYD
4.0K    nagios_hostdependencies.MYI
12K     nagios_hostescalation_contactgroups.frm
0       nagios_hostescalation_contactgroups.MYD
4.0K    nagios_hostescalation_contactgroups.MYI
12K     nagios_hostescalation_contacts.frm
0       nagios_hostescalation_contacts.MYD
4.0K    nagios_hostescalation_contacts.MYI
12K     nagios_hostescalations.frm
0       nagios_hostescalations.MYD
4.0K    nagios_hostescalations.MYI
12K     nagios_hostgroup_members.frm
4.0K    nagios_hostgroup_members.MYD
4.0K    nagios_hostgroup_members.MYI
12K     nagios_hostgroups.frm
4.0K    nagios_hostgroups.MYD
4.0K    nagios_hostgroups.MYI
12K     nagios_host_parenthosts.frm
0       nagios_host_parenthosts.MYD
4.0K    nagios_host_parenthosts.MYI
12K     nagios_hosts.frm
20K     nagios_hosts.MYD
8.0K    nagios_hosts.MYI
16K     nagios_hoststatus.frm
32K     nagios_hoststatus.MYD
28K     nagios_hoststatus.MYI
12K     nagios_instances.frm
4.0K    nagios_instances.MYD
4.0K    nagios_instances.MYI
12K     nagios_logentries.frm
183M    nagios_logentries.MYD
97M     nagios_logentries.MYI
12K     nagios_notifications.frm
115M    nagios_notifications.MYD
57M     nagios_notifications.MYI
12K     nagios_objects.frm
100K    nagios_objects.MYD
104K    nagios_objects.MYI
12K     nagios_processevents.frm
384K    nagios_processevents.MYD
80K     nagios_processevents.MYI
12K     nagios_programstatus.frm
4.0K    nagios_programstatus.MYD
4.0K    nagios_programstatus.MYI
12K     nagios_runtimevariables.frm
4.0K    nagios_runtimevariables.MYD
4.0K    nagios_runtimevariables.MYI
12K     nagios_scheduleddowntime.frm
0       nagios_scheduleddowntime.MYD
4.0K    nagios_scheduleddowntime.MYI
12K     nagios_servicechecks.frm
0       nagios_servicechecks.MYD
4.0K    nagios_servicechecks.MYI
12K     nagios_service_contactgroups.frm
4.0K    nagios_service_contactgroups.MYD
8.0K    nagios_service_contactgroups.MYI
12K     nagios_service_contacts.frm
60K     nagios_service_contacts.MYD
108K    nagios_service_contacts.MYI
12K     nagios_servicedependencies.frm
0       nagios_servicedependencies.MYD
4.0K    nagios_servicedependencies.MYI
12K     nagios_serviceescalation_contactgroups.frm
0       nagios_serviceescalation_contactgroups.MYD
4.0K    nagios_serviceescalation_contactgroups.MYI
12K     nagios_serviceescalation_contacts.frm
0       nagios_serviceescalation_contacts.MYD
4.0K    nagios_serviceescalation_contacts.MYI
12K     nagios_serviceescalations.frm
0       nagios_serviceescalations.MYD
4.0K    nagios_serviceescalations.MYI
12K     nagios_servicegroup_members.frm
0       nagios_servicegroup_members.MYD
4.0K    nagios_servicegroup_members.MYI
12K     nagios_servicegroups.frm
0       nagios_servicegroups.MYD
4.0K    nagios_servicegroups.MYI
12K     nagios_service_parentservices.frm
0       nagios_service_parentservices.MYD
4.0K    nagios_service_parentservices.MYI
12K     nagios_services.frm
272K    nagios_services.MYD
64K     nagios_services.MYI
16K     nagios_servicestatus.frm
556K    nagios_servicestatus.MYD
348K    nagios_servicestatus.MYI
12K     nagios_statehistory.frm
25M     nagios_statehistory.MYD
3.0M    nagios_statehistory.MYI
12K     nagios_systemcommands.frm
28K     nagios_systemcommands.MYD
12K     nagios_systemcommands.MYI
12K     nagios_timedeventqueue.frm
0       nagios_timedeventqueue.MYD
4.0K    nagios_timedeventqueue.MYI
12K     nagios_timedevents.frm
0       nagios_timedevents.MYD
4.0K    nagios_timedevents.MYI
12K     nagios_timeperiods.frm
4.0K    nagios_timeperiods.MYD
4.0K    nagios_timeperiods.MYI
12K     nagios_timeperiod_timeranges.frm
4.0K    nagios_timeperiod_timeranges.MYD
8.0K    nagios_timeperiod_timeranges.MYI
12K     nagios_logentries.frm

Re: Nagiosxi DB size or rotate for log file

Posted: Wed Jul 08, 2015 10:01 am
by abrist
michaelli wrote:Now the setting is 90 days. Does it mean it will keep all hosts eg. system log, application log for both active and passive for 90 days?
Those are indeed included in the logentries table. To clarify, the logentries table stores all entries that are written to the nagios.log files for the time specified. In XI, this is primarily used for the "Event Log" page. Availability, state/status, and uptime information are pulled through the avail.cgi directly (from the log files) or from other tables, so truncating this table (or altering the age in performance settings) will not effect any of the reports.
michaelli wrote:Below table show the file under /var/lib/mysql/nagios. Now we can observe the nagios_logentries.MYD grow to 183M. Does this file store the all hosts logs and does it control the logrotate by "Max Log Entries Age" which I mention above.
This does not control logrotate - Nagios Core does through a few different directives in nagios.cfg. This table stores all log entry lines for the given age.
If this table grows too big, the "Event Log" page in XI will load slow or not at all. It can also become more susceptible to crashes as it gets too large. How large completely depends on your system. A good way to check is to check to see how long it take to load the "Event Log" page.