Build precise queries to find exactly what you need
Press ESC to close
It seems strange that half of the script is just comments. I replaced it with this script:
#!/usr/bin/perl -w
use strict; use Getopt::Long; use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; use constant RETCODES => qw ( OK WARNING CRITICAL UNKNOWN ) ; use File::Temp qw/ tempfile tempdir /;
sub error { my ($rc,$msg)=@_; printf “%s: %s “,(RETCODES)[$rc],$msg; exit($rc); }
my $dir; if($ARGV[0]){ $dir = $ARGV[0]; }else{ error(UNKNOWN,”No input, specify a directory”) } my $tmp = File::Temp->new( DIR => $dir );
chdir $dir or error(CRITICAL,”Could not cwd to $dir”);
open FOUT,”> $tmp” or error(CRITICAL,”Could to write to $dir”); close FOUT;
printf “OK: $dir is writable. “; exit(OK);
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!