Flume DFO local storage usage check
It might be useful when flume driver failed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 !/usr/bin/perl #Check flume DFO directory size sub trim($); use strict; use warnings; my $exit=0; my $backlog_size = `du -s flume | awk {‘print \$1’}`; $backlog_size = trim($backlog_size); if ( !$ARGV[0] || !$ARGV[1]) { ########################### Usage of the plugin print “check_flume_backlog critical_size warning_size \n”; exit 0; } ######################### Case 1 if State is Critical if ($backlog_size > $ARGV[0]) { print “Critical: “.$backlog_size.”b\n”; exit 2; } ######################## Case 2 if State is Warning if($backlog_size > $ARGV[1] || $backlog_size == 0) { print “Warning: “.$backlog_size.”b\n”; exit 1; } ######################## Case 3 if State is OK if($backlog_size < $ARGV[0] && $backlog_size < $ARGV[1]) { print “OK: “.$backlog_size.”b\n”; exit 0; } sub trim($) { my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } And for centralised monitoring..