Looking for a plugin that


#1

Im looking for a plugin that will check a file to make sure that its size IS increasing.

in other words, at 1:00pm I want to look at the file size, at 1:05pm i want to look at the file size and compare it to 1:00pm. if the size has increased that is good, if it has NOT increased, that is bad.

Does anything like this exist?

NF


#2

doubt it. that’s a pretty easy bash script. a nagios plugin is just a script that does stuff and returns a 0 (OK) or a 2 (critical). heres an untested script for you:

#!/bin/bash

FILESIZE = ls -la /path/to/file.txt | awk '{print $5}' OLDFILESIZE =cat /tmp/sizehistory.txt`

if “$FILESIZE” -gt “$OLDFILESIZE” ]
then
echo "OK: File has grown!"
echo $FILESIZE > /tmp/sizehistory.txt
exit 0
else
echo "CRITICAL: File hasn’t grown"
exit 2
fi

but before running that, create a sizehistory.txt file so the script doesn’t error out. do a
$ echo “1” > /tmp/sizehistory.txt

good luck. you sound like a windows guy, learn to script! bash, python, and perl are all powerful and extremely useful. you won’t regret it!