| 1 | #!/usr/bin/env perl | ||
| 2 | # | ||
| 3 | # Plugin for checking availability and (sometimes) correctness | ||
| 4 | # of an application (whose name is part of this script's name). | ||
| 5 | # | ||
| 6 | # Usage: get-date.pl | ||
| 7 | # | ||
| 8 | # The return code and STDOUT are compatible with the Nagios plugins | ||
| 9 | # (see: http://nagios.sourceforge.net/docs/3_0/quickstart.html) | ||
| 10 | # | ||
| 11 | # September 2011 | ||
| 12 | # Author: Martin Senger <martin.senger@gmail.com> | ||
| 13 | #----------------------------------------------------------------- | ||
| 14 | |||
| 15 | use warnings; | ||
| 16 | use strict; | ||
| 17 | |||
| 18 | use Monitor::Simple; | ||
| 19 | use constant { MY_ID => 'date' }; | ||
| 20 | |||
| 21 | # read command-line arguments and configuration | ||
| 22 | my ($config_file, $service_id) = Monitor::Simple::Utils->parse_plugin_args (MY_ID, @ARGV); | ||
| 23 | my $config = Monitor::Simple::Config->get_config ($config_file); | ||
| 24 | |||
| 25 | # everything is okay | ||
| 26 | Monitor::Simple::Utils->report_and_exit (MY_ID, $config, Monitor::Simple::RETURN_OK, scalar localtime); | ||
| 27 | |||
| 28 | __END__ |