Welcome to docs.opsview.com

Differences

This shows you the differences between two versions of the page.

opsview4.6:logfiles [2014/09/09 12:19] (current)
Line 1: Line 1:
 +====== Log Files ======
 +Opsview is made up of several different daemons, each of which log to their own file.  Most of these log files are stored on the Master server, but some may also be found on any slaves servers in a distributed architecture.
 +
 +===== NagiosĀ® Core Daemon ======
 +
 +==== Main log file ====
 +The Nagios Core daemon logs to ''/usr/local/nagios/var/nagios.log'' and holds state change information.  This log file is also used by the Nagios Core CGIs when reporting on availability, state changes and notifications.
 +
 +Archive log files are stored in ''/usr/local/nagios/var/archives''. In Opsview, the default rotation period for the log files is daily.
 +
 +=== Log File Format ===
 +The Nagios Core log files are in the format of:
 +<code>
 +[{timestamp}] {text}
 +</code>
 +
 +The //timestamp// is in time_t format, so will be displayed as the number of seconds since January 1, 1970.
 +
 +You can run run ''/usr/local/nagios/bin/nlcat'' - which by default will read ''/usr/local/nagios/var/nagios.log'' - and convert the time stamp into a human readable format. (You can get this script and install yourself from https://secure.opsera.com/svn/opsview/trunk/opsview-core/bin/nlcat).  ''nlcat'' has further options such as searching for a specific piece of text, and also working with archived log files (in date order) - please see the included help text (''nlcat --man'').
 +
 +Alternatively, you can change all the timestamps within the log file to a readable format with the following code. This will change the file:
 +<code>
 +perl -i -pe '($t) = ($_ =~ m/^\[(\d+)\]/); $nice=scalar localtime $t; s/^\[(\d+)\]/[$nice]/' filename.log
 +</code>
 +**Only do this on copies** of the log files. Do **not** do this for the live or the archive log files, as this will stop Nagios Core from being able to read them.
 +
 +==== Debug log file ====
 +
 +When debugging has been manually enabled in nagios.cfg, ''/usr/local/nagios/var/log/nagios.debug'' is created containing in-depth debugging information (depending on the settings in nagios.cfg).  Please see the nagios documentation for more information.
 +
 +===== Opsview UI =====
 +
 +The web interface logs to ''/var/log/opsview/opsview-web.log'' and at default logging levels include user logins.
 +
 +Log rotation is done on size and older files are stored in the same directory.
 +
 +==== Log File Format ====
 +The opsview-web.log format is:
 +<code>
 +[{timestamp}] [<module>] [<level>] {text}
 +</code>
 +
 +The logging level can be amended by changing ''/usr/local/opsview-web/etc/Log4perl.conf'' and changing the line
 +<code>
 +log4perl.rootLogger=INFO, LOGFILE, SCREEN
 +</code> to read <code>
 +log4perl.rootLogger=DEBUG, LOGFILE, SCREEN
 +</code>
 +The UI daemon does not have to be restarted - the change in level will be made within 30 seconds of the file being saved.
 +
 +===== Opsview Daemons =====
 +
 +Many of the Opsview scripts and daemons log to ''/var/log/opsview/opsviewd.log'', recording stopping and starting of daemons as well as actions taken.
 +
 +Log rotation is done on size and older files are stored in the same directory.
 +
 +==== Log File Format ====
 +The opsviewd.log format is:
 +<code>
 +[{timestamp}] [<script or daemon>] [<level>] {text}
 +</code>
 +
 +The logging level can be amended by changing ''/usr/local/nagios/etc/Log4perl.conf'' and removing the comment characters from the start of the appropriate line.  The UI daemon does not have to be restarted - the change in level will be made within 30 seconds of the file being saved.
 +
 +===== Supplementary Log Files =====
 +
 +Further log files are stored in the ''/usr/local/nagios/var/log'' directory, are rotated on a weekly basis, with older logs renamed with a numerical suffix.
 +
 +==== create_and_send_configs.debug ====
 +
 +Record of the reload process to show where time is spent during a reload.  Recreated on each reload, no archives kept.
 +
 +==== DBVersion.log ====
 +
 +Database upgrade log file, only updated during Opsview upgrades
 +
 +==== mrtgconfgen.log ====
 +
 +When ''mrtg'' is enabled against a host, pertinent information is logged here when a reload is performed
 +
 +==== mrtg_genstats.log ====
 +
 +When ''mrtg'' is enabled against a host, pertinent information is logged here whenever a scan is run of the host.
 +
 +==== rsync_nmis_database.log ====
 +
 +==== snmptrap2nagios.log ====
 +
 +When ''SNMP Traps'' are configured then whenever a trap is received pertinent information about rule evaluation is logged here.
Navigation
Print/export
Toolbox