Plugin to check MD5 sum on certain files

Leif Nixon nixon at nsc.liu.se
Tue Nov 9 16:29:23 CET 2004


"Dan Spray" <danslists at conpoint.com> writes:

> Okay, with all of that sorted out does anyone actually have an idea for a
> plugin?

At least the GNU md5sum makes this rather easy. Basically you
just initialize a checksum file by running something like:

  $ md5sum /bin/ls /bin/ps > checksums

To check for changes, use the "--check" option:

  $ md5sum --check checksums
  /bin/ls: OK
  /bin/ps: OK
  $ echo $?
  0

If something has changed:

  $ md5sum --check checksums
  /bin/ls: FAILED
  /bin/ps: OK
  md5sum: WARNING: 1 of 2 computed checksums did NOT match
  $ echo $?
  1

Wrapping this up in a script that runs md5sum and returns the proper
exit codes that Nagios expects takes just a few lines of code.

-- 
Leif Nixon                                    Systems expert
------------------------------------------------------------
National Supercomputer Centre           Linkoping University
------------------------------------------------------------


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list