From 48197c0c80ca58dc95f00b184c7ab1e2fda6a0ec Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 3 Mar 2009 10:51:39 +0000 Subject: [PATCH] small changes. Sergey. --- plugins/README | 57 +++++++++++++++++++++------------------- plugins/my_check_dhcp.pl | 14 +++++++--- plugins/restart.pl | 4 +-- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/plugins/README b/plugins/README index 034843f..e694f10 100644 --- a/plugins/README +++ b/plugins/README @@ -1,33 +1,36 @@ -Plugin Location Comment --------------------------------------------------------------- -check_backup.pl hadeb07 checks backup on hadeb07. - Runs status server to report - status to Nagios. +Plugin Location Comment +-------------------------------------------------------------------- +check_backup.pl hadeb07 Remote script. Checks backup + on hadeb07. Runs status server + to report status to Nagios. -check_archiver.pl lxg0434 checks archiving process of - slow ctrl data to Oracle. - Runs status server to report - status to Nagios. +check_archiver.pl lxg0434 Remote script. Checks archiving + process of slow ctrl data to + Oracle. Runs status server to + report status to Nagios. -check_archivist.pl hadesdaq run by Nagios to check - hades_archivist via - TCP socket connection. +check_archivist.pl hadesdaq Run by Nagios to check + hades_archivist via + TCP socket connection. -check_lustre.pl lxhadesdaq checks Lustre mount. Checks - used disk space on Lustre. - Runs status server to report - status to Nagios. +check_lustre.pl lxhadesdaq Remote script. Checks Lustre + mount. Checks used disk space + on Lustre. Runs status server + to report status to Nagios. -my_check_eblog.pl lxhadesdaq checks discarded events in - eb_s.tcl written by EB. - Runs status server to report - status to Nagios. +my_check_eblog.pl lxhadesdaq Remote script. Checks discarded + events in eb_s.tcl written by EB. + Runs status server to report + status to Nagios. -my_check_proc_status.pl hadesdaq run by Nagios to receive - status report from remote - scripts. +my_check_proc_status.pl hadesdaq Run by Nagios to receive + status report from remote + scripts. -restart.pl restarts a program (daemon) - given as an argument on a list - of remote machines. For example - used to restart check_lustre.pl +my_check_dhcp.pl hadesdaq Run by Nagios. Checks if dhcp + daemon is running. + +restart.pl Restarts a program (daemon) + given as an argument on a list + of remote machines. For example + used to restart check_lustre.pl diff --git a/plugins/my_check_dhcp.pl b/plugins/my_check_dhcp.pl index 469d2f3..596dde8 100755 --- a/plugins/my_check_dhcp.pl +++ b/plugins/my_check_dhcp.pl @@ -1,11 +1,11 @@ #!/usr/bin/perl -w -# ---------------------------------------------------------------------------- +# ------------------------------------------------------------------------------ # File Name: my_check_process.pl # Author: Sergey Yurevich # Date: 05/04/2007 # Version: 0.1 # Description: script will check if there is a process running -# ---------------------------------------------------------------------------- +# ------------------------------------------------------------------------------ use strict; use warnings; @@ -19,17 +19,23 @@ my ($ip) = @ARGV; #dhcping - check dhcp service #-c 140.181.67.143 - from hadesdaq (140.181.67.143) #-s 140.181.75.158 - on lxhadesdaq (140.181.75.158) -#-h 00:40:9E:00:99:E2 - if one gets an answer from MAC address (00:40:9E:00:99:E2) +#-h 00:30:48:58:c0:88 - if one gets an answer from MAC (hadeb06) +# used to be MAC of hadc02 (00:40:9E:00:99:E2) -my $answer = `dhcping -c 140.181.67.143 -s $ip -h 00:40:9E:00:99:E2`; +my $answer = `dhcping -c 140.181.67.143 -s $ip -h 00:30:48:58:c0:88`; chop($answer); +#print "pids = $pids\n"; +#my @pid_list = split(' ',$pids); + my $state; if($answer =~/Got answer from/){ + #nagios exit code 0 = status OK = green $state = $ERRORS{'OK'}; } else{ + #nagios exit code 2 = status CRITICAL = red $state = $ERRORS{'CRITICAL'}; } diff --git a/plugins/restart.pl b/plugins/restart.pl index 1492de8..3206c51 100755 --- a/plugins/restart.pl +++ b/plugins/restart.pl @@ -22,8 +22,8 @@ if($opt_h){ &checkArgs(); #--- on these PCs the script should be restarted: -my @PCList = ('lxg0429','lxg0433','lxg0435','lxg0437','lxg0439','lxg0440','lxg0441','lxg0442','lxg0443','lxg0444','lxg0445','lxg0446','lxg0447','lxg0448','lxg0452','lxg0453','lxg0454','lxg0455'); -#my @PCList = ('lxg0447'); +#my @PCList = ('lxg0429','lxg0433','lxg0435','lxg0437','lxg0439','lxg0440','lxg0441','lxg0442','lxg0443','lxg0444','lxg0445','lxg0446','lxg0447','lxg0448','lxg0452','lxg0453','lxg0454','lxg0455'); +my @PCList = ('lxg0429'); my $args = "-d"; #- arguments of script to be restarted &main(); -- 2.43.0