root/INODES.pl

Revision 9adf5e86f48122c081b0557248285f968efd7e52, 499 bytes (checked in by Theo Schlossnagle <jesus@omniti.com>, 13 years ago)

INODES monitor and setsid/fork support

git-svn-id: https://labs.omniti.com/resmon/trunk@6 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

  • Property mode set to 100755
Line 
1 #!/usr/bin/perl
2
3 register_monitor('INODES', sub {
4   my $arg = shift;
5   my $os = fresh_status($arg);
6   return $os if $os;
7   my $devorpart = $arg->{'object'};
8   my $output = cache_command("df -i", 30);
9   my ($line) = grep(/$devorpart\s*/, split(/\n/, $output));
10   if($line =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%/) {
11     if($4 <= $arg->{'limit'}) {
12       return set_status($arg, "OK($2 $4% full)");
13     }
14     return set_status($arg, "BAD($2 $4% full)");
15   }
16   return set_status($arg, "BAD(no data)");
17 });
18
Note: See TracBrowser for help on using the browser.