nagiostats Config Parameters

Jochen Bern Jochen.Bern at LINworks.de
Fri May 11 21:34:39 CEST 2012


Everyone,

I played with the "-c" and "-s" Parameters of a 3.2.3's nagiostats today
and noticed the odd behavior shown below. I didn't look at the source
yet, much less write a patch, but I thought you might want to check on
3.3.x and 3.4.x beforehand (and maybe extend t/705nagiostats.t a bit).

Kind regards,
								J. Bern

Normal operation:

# N="/usr/local/nagios"
# $N/bin/nagiostats -m -d NUMSVCOK
1659


status.dat has been moved elsewhere (onto a ramdisk):

# strings - $N/bin/nagiostats | grep /nagios/
/usr/local/nagios/etc/nagios.cfg
/usr/local/nagios/var/status.dat
# grep /status.dat $N/etc/nagios.cfg
status_file=/usr/local/nagios/var/spool/status.dat
# strace $N/bin/nagiostats -m -d NUMSVCOK 2>&1 | \
>    egrep '/nagios/[a-z/]*[a-z]*\.'
open("/usr/local/nagios/etc/nagios.cfg", O_RDONLY) = 3
open("/usr/local/nagios/var/spool/status.dat", O_RDONLY) = 3


Specifying nagios.cfg explicitly works:

# $N/bin/nagiostats -c $N/etc/nagios.cfg -m -d NUMSVCOK
1659


Specifying status.dat explicitly - no go:

# $N/bin/nagiostats -s $N/var/spool/status.dat -m -d NUMSVCOK
0
# $N/bin/nagiostats -s$N/var/spool/status.dat -m -d NUMSVCOK
0
# $N/bin/nagiostats --statsfile $N/var/spool/status.dat -m -d NUMSVCOK
0
# $N/bin/nagiostats --statsfile=$N/var/spool/status.dat -m -d NUMSVCOK
0

(Doesn't work together with -c, either.)


It *does* read the status.dat, though:

# strace $N/bin/nagiostats -s $N/var/spool/status.dat -m -d NUMSVCOK \
> 2>&1 | egrep '^open'
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libm.so.6", O_RDONLY)        = 3
open("/lib/libc.so.6", O_RDONLY)        = 3
open("/usr/local/nagios/var/spool/status.dat", O_RDONLY) = 3

(... but where'd nagios.cfg go ... ?)
-- 
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/




More information about the Developers mailing list