How to get retention.dat working?


#1

I’m trying to get retention.dat working on nagios 2.0b6, below is my config. The file retention.dat is never created, even if I set the interval to a low value (or even 0, I’ve tried tail -f 'ing the file during a sighup). Any ideas? It’s not likely a permissions problem, I’ve even tried creating the file with 0777 perms, it just never gets populated with data. Am I missing something?

retain_state_information=1
state_retention_file=/var/spool/nagios/retention.dat
retention_update_interval=60
use_retained_program_state=1
use_retained_scheduling_info=0

define service{
name generic-service
active_checks_enabled 1
passive_checks_enabled 0
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 0
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
register 0
}

define service{
use generic-service
host_name some_random_hostname
service_description SSH Secure Shell
is_volatile 0
check_period 24x7
max_check_attempts 2
normal_check_interval 5
retry_check_interval 1
contact_groups level_1_notifications
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ssh
}

-mike


#2

You don’t create the file, let nagios create it.
ls -la /var/spool is what?
also what user does nagios run as?


#3

Thanks for the assistance. I know that retention.dat is a generated file, but after never seeing it get created I tried creating a blank retention.dat as 0777 just to make sure that nagios had permissions to write the file. Nagios is set to drop to the ‘nagios’ user and group, and appears to be running correctly as that uid/gid. Here’s an ls of the directories:

/var/spool # ls -la
drwxrwxrwx 2 nagios nagios 512 Jan 3 09:54 nagios

/var/spool/nagios # ls -la
-rw-rw-r-- 1 nagios nagios 784 Dec 29 18:35 comments.dat
-rw-rw-r-- 1 nagios nagios 241 Dec 28 15:21 downtime.dat
prw-rw---- 1 nagios nagios 0 Jan 3 09:54 nagios.cmd
-rw-r–r-- 1 nagios nagios 6 Jan 3 09:54 nagios.lock
-rw-rw-r-- 1 nagios nagios 165973 Jan 3 09:54 objects.cache
-rw-rw-r-- 1 nagios nagios 1294 Jan 3 09:55 perfdata.dat
-rw-rw-r-- 1 nagios nagios 165614 Jan 3 09:55 status.dat

BTW, any ‘persistant’ comments I put on a service do stay there when nagios is reset. It’s just disabled active service checks and disabled service notifications that are forgotten when nagios is sighup’d.

-mike

Edited Tue Jan 03 2006, 05:26PM ]


#4

from the 2.0rc1 changelog:
Fixed bug with comments not expiring (for some reason this was not previously implemented!)

Luca


#5

I did read that changelog comment, but I’m fairly certain that this was a different issue altogether.

-mike


#6

uh…
i didn’t read your post well. sorry… just saw comments and got to fetch this bit of info which i read today…
Sorry.

Luca


#7

Is anyone else seeing retention.dat created in 2.0b6 or rc1?

-mike


#8

bumping… ba… bump


#9

/etc/rc.d/init.d/nagios stop
Now, that you THINK it’s stopped, do a :
ps -ef|grep nagios
You might see several.
So kill them
kill pid
Now do another ps until you have killed all nagios.
Now start nagios again.
/etc/rc.d/init.d/nagios start
I’m saying this because I think you have made changes to your nagios.cfg file, etc, and they have NOT been applied yet, since nagios has NEVER been killed yet.
Edited Fri Jan 06 2006, 08:22PM ]


#10

It is being stopped completely (no nagios processes), still the retention.dat file is never created after I restart the process (either manually or via init). I’ve tried retention_update_interval values of 0,3 and 60, and have given plenty (24hrs) of time between each of my tests to insure that all service checks have completed hard.

I haven’t yet found a problem with my above config, so I’m asking anyone running 2.0b6 or later to report if they ever see this file being created. I’m holding off from posting this to the nagios-devel list until I at least see one other person reporting this as a bug.

-mike

Edited Fri Jan 06 2006, 09:28PM ]