2

I have just set up a Nagios server, and by default it keeps archives of the log messages in /var/log/nagios3/archives. However the files are named with US style date format, like nagios-04-14-2015-00.log, for a log file for 14th April 2015.

Is there anyway to change the filename? Sometimes I'd like to manually investigate alerts & configuration and want to grep the log files. However this date format confused me and slows me down, and for me is bad UI.

I am aware this could break the "view old log files" on the nagios interface, and would accept that trade-off.

Amandasaurus
  • 31,471
  • 65
  • 192
  • 253

1 Answers1

2

Just changing the filenames will break all sorts of things in the web interface. Starting with viewing old logs, as you mentioned, but also including all of the trend graphs, availability reports, alert history, notification history, etc.

You'd have to modify date format in the source and recompile to fix all of this.

A better option is to set use_syslog=1 in nagios.cfg, and then configure syslog to write the nagios log files somewhere else. Then you can use logrotate to rotate them with whatever name format you want.

Keith
  • 4,637
  • 15
  • 25