Error: Cannot open log file '/var/spool/nagios/nagios.log' for reading!
# ls -l /var/spool/nagios/nagios.log
-rw-r----- 1 nagios nagios 925763 Feb 17 18:17 /var/spool/nagios/nagios.log
https://github.com/NagiosEnterprises/nagioscore/issues/303
# cd /usr/ports/net-mgmt/nagios4/
# make patch
# less work/nagios-4.5.11/base/logging.c
...
static FILE *open_log_file(void)
{
int fh;
struct stat st;
if(log_fp) /* keep it open unless we rotate */
return log_fp;
if ((fh = open(log_file, O_RDWR|O_APPEND|O_CREAT|O_NOFOLLOW, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) == -1) {
if (daemon_mode == FALSE)
printf("Warning: Cannot open log file '%s' for writing\n", log_file);
return NULL;
...
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 22:37:57 |
| Calls: | 810 |
| Calls today: | 1 |
| Files: | 1,287 |
| D/L today: |
12 files (21,036K bytes) |
| Messages: | 195,759 |