[Nagios-devel] nagiostats Config Parameters

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] nagiostats Config Parameters

Post by Guest »

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=3D"/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=3D/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) =3D 3
open("/usr/local/nagios/var/spool/status.dat", O_RDONLY) =3D 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=3D$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) =3D 3
open("/lib/libm.so.6", O_RDONLY) =3D 3
open("/lib/libc.so.6", O_RDONLY) =3D 3
open("/usr/local/nagios/var/spool/status.dat", O_RDONLY) =3D 3

(... but where'd nagios.cfg go ... ?)
--=20
Jochen Bern, Systemingenieur --- LINworks GmbH
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP =3D D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C2=
7
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Gesch=E4ftsf=FChrer Metin Dogan, Oliver Mic=
hel





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: Jochen.Bern@LINworks.de
Locked