willixix / naglio-plugins

Monitoring Plugins by William Leibzon
http://william.leibzon.org/nagios/
77 stars 54 forks source link

check_files.pl: now able to sum the size of files (can do it using SSH) and search which file is bigger. #15

Closed bpat closed 11 years ago

bpat commented 11 years ago

Hello,

Here is some modifications we did on the script check_files.pl, we wanted to share this change with you ;-)

The script can check the size sum of searched files with "-S". It can also returns the biggest file from a list and with "-H" it can execute ls command remotly on a host using SSH.

Here are the changes:

Examples:

Compute the sum size of files:

$ ./check_files.pl -D /opt/oradata -F"t" -f -S -H "10.224.20.48"
OK - Sum of file sizes is 3897 octet, 2 t files found | 't'=2 size_sum=3897o

Search largest file:

$ ./check_files.pl -D /opt/oradata -F"t" -f -s -H "10.224.20.48"
OK - Largest size file is 3896 octet, 2 t files found | 't'=2 size_largest=3896o size_smallest=1o

Combined:

$ ./check_files.pl -D /opt/oradata -F"t" -f -S -s -H "10.224.20.48"
OK - Largest size file is 3896 octet, Sum of file sizes is 3897 octet, 2 t files found | 't'=2 size_largest=3896o size_smallest=1o size_sum=3897o

Warning and Critical thresholds can also be set.

Bye, Patrick