SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Nagios Plugin for Tape Libraries...
Author Message
Post Nagios Plugin for Tape Libraries... 
So I'm stuck at the office and this plugin we wrote has been such a
lifesaver, I figured I'd give it out to the community...

Here is our GroundWork GDMA external command, you may have to use your own
mechanism for running this on a vanilla Nagios environment...

Check_networker_edl[1]_Enable="ON"
Check_networker_edl[1]_Service="check_networker_edl"
Check_networker_edl[1]_Command="check_networker_edl.pl full 10 5"

Basically run the command...

"check_networker_edl.pl full 10 5"

10TB left is a WARNING
5TB left is a CRITICAL


Here is the check command we use (note that the EDL name is hard coded into
the program, please feel free to improve it):
cat check_networker_edl.pl
#!/usr/bin/perl
use strict;
use warnings;
my $pool = $ARGV[0];
my $warnvalue = $ARGV[1];
my $critvalue = $ARGV[2];

my < at > info = qx(/bin/echo "show current capacity\nprint type: NSR jukebox
; name: *EDL*" | /usr/sbin/nsradmin -i -);
my $lista = join ('', < at > info);
my < at > pools = split(',',$lista);
#print "$pools[0] \n";
if ($#ARGV < 2) {
die "Usage: check_networker_edl.pl pool warnvalue
critvalue \n";
}#end if


if ($pool eq "full")
{
my < at > full_s = split(' ',$pools[0]);
my $full_v = $full_s[2];
for ($full_s[3])
{
if ($full_s[3] eq "GB") { $full_v = ($full_v/1024);
$full_s[3]='TB';}
elsif ($full_s[3] eq "KB") { $full_v = (($full_v/1024)/1024);
$full_s[3]='TB'; }
else { $full_v = $full_s[2] }

}
for ($full_v)
{
if ($full_v < $critvalue) { print "CRITICAL - Storage space on
the *EDL* lower than the critical value of $critvalue $full_s[3] Free:
$full_v $full_s[3] \n"; exit 2; }
if ($full_v < $warnvalue) { print "WARNING - Storage space on
the *EDL* lower than the warning value of $warnvalue $full_s[3] Free:
$full_v $full_s[3] \n"; exit 1; }
else { print "OK - Storage space is OK for the* EDL* Free:
$full_v $full_s[3]\n"; exit 0; }
}

}

Here is the output from the running plugin:
# ./check_networker_edl.pl full 10 5
WARNING - Storage space on the EDL lower than the warning value of 10 TB
Free: 6.013671875 TB


via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB