Added STATE_OK to version and help and added copyright info
This commit is contained in:
parent
1d2a9e4072
commit
98892c9c03
Binary file not shown.
@ -1,6 +1,39 @@
|
|||||||
#!/usr/bin/php5
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# #
|
||||||
|
# Copyright (C) 2013 Jack-Benny Persson <jack-benny@cyberinfo.se> #
|
||||||
|
# #
|
||||||
|
# This program is free software; you can redistribute it and/or modify #
|
||||||
|
# it under the terms of the GNU General Public License as published by #
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or #
|
||||||
|
# (at your option) any later version. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, #
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||||
|
# GNU General Public License for more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License #
|
||||||
|
# along with this program; if not, write to the Free Software #
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
# #
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# #
|
||||||
|
# Nagios plugin to monitor a single files MD5 sum. In case of mismatch #
|
||||||
|
# the plugin exit with a CRICITAL error code. This behavior can be changed #
|
||||||
|
# with the --warning argument. #
|
||||||
|
# Rewritten in PHP (depending on PEAR ConsoleGetopt. #
|
||||||
|
# #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
//include PEAR ConsoleGetopt
|
//include PEAR ConsoleGetopt
|
||||||
include ("Console/Getopt.php");
|
include ("Console/Getopt.php");
|
||||||
|
|
||||||
@ -85,6 +118,7 @@ if(sizeof($opts) > 0)
|
|||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
print_version();
|
print_version();
|
||||||
|
exit ($STATE_OK);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '--file':
|
case '--file':
|
||||||
@ -116,6 +150,7 @@ if (empty($md5))
|
|||||||
exit($STATE_UNKNOWN);
|
exit($STATE_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// MAIN
|
// MAIN
|
||||||
// Compare the file against the MD5 checksum
|
// Compare the file against the MD5 checksum
|
||||||
$file = md5_file($filename);
|
$file = md5_file($filename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user