How to calculate cache file usage (for Nagios monitoring) in varnish 3?

Sascha Ottolski ottolski at web.de
Mon Nov 19 19:57:39 CET 2012


Hi there,

I'm wondering how I can monitor the actual usage of the cache "space".
Previous versions of the Nagios plugin had a "usage" parameter, that
would spit out a fill level as a percentage. Seems seems to have gone
away. I tried to roll my own by simply dividing

SMF.s0.c_bytes (Bytes allocated) by SMF.s0.g_space (Bytes available)

However, I misunderstood the semantics, the latter value does give me
the amount of free space, not the total size of the cache file.

I could get the configured size from the config file

    VARNISH_STORAGE_SIZE=512676693.9k

or the commandline that is constructed from it

    -s file,/var/cache/varnish/store.bin,512676693.9k

but that feels a bit hacky to me. Any way to get that information from
the running instance?

Thanks in advance for any pointers

Sascha



More information about the varnish-misc mailing list