[Nagiosplug-devel] [ nagiosplug-Patches-1847879 ] check_ram plugin (based on check_swap)
dermoth at aei.ca
Tue Dec 11 14:51:33 CET 2007
-----BEGIN PGP SIGNED MESSAGE-----
On 11/12/07 03:13 AM, Andreas Ericsson wrote:
> Thomas Guyot-Sionnest wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> On 10/12/07 09:35 AM, Andreas Ericsson wrote:
>>> Why not just use sysconf(_SC_PHYS_PAGES) - sysconf(_SC_AV_PHYS_PAGES) ?
>>> Fiddling with /proc/meminfo isn't very portable.
>> Lol. I didn't read the plug-in yet but I would have assumed from start
>> that it was portable. I'm sure we want a memory check plugin, so I'll
>> rework it it there's a way to make it portable. This won't be for the
>> upcoming release though...
> _SC_PHYS_PAGES and _SC_AV_PHYS_PAGES are in POSIX.1-2001. They need to
> be multiplied with _SC_PAGESIZE (defined in the same standard) to get
> actual byte values (which may well be huge), but many systems support
> it even though they don't follow the rest of the standard.
> I'd suggest finding the correct value to divide the resource-values
> with to get human-readable numbers and just storing everything in
> unsigned long's.
Thanks for the info!
> Something like the attached, perhaps? It doesn't really give very
> accurate numbers though, since nearly all unices cache until physical
> RAM is pretty much full. It doesn't parse arguments or anything
I'm aware of that. Honestly there's not much point of a ram check that
doesn't subtracts cache memory. While it works on most servers, servers
with very stable memory usage can get very close to 0 MB free (I've seen
only a few megs free on our 32GB database, for example!).
I'll see what I can do. Maybe getting cache via another mean on
supported platforms... There's plenty of memory checks out there not
taking count of cache anyways ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Devel