[Mon-commit] mon/clients mon.cgi,1.1,1.2 moncmd,1.1.1.1,1.2 monremote.pl,1.1,1.2 monshow,1.1.1.1,1.2
Brought to you by:
trockij
From: David N. <vi...@us...> - 2004-11-15 14:45:27
|
Update of /cvsroot/mon/mon/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9218/clients Modified Files: moncmd monremote.pl monshow Added Files: mon.cgi Log Message: Pulling lots of changes from the 1.0.0pre* branch into the HEAD, to prepare to tag mon-1.1pre1 Index: moncmd =================================================================== RCS file: /cvsroot/mon/mon/clients/moncmd,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** moncmd 9 Jun 2004 05:18:07 -0000 1.1.1.1 --- moncmd 15 Nov 2004 14:45:17 -0000 1.2 *************** *** 216,243 **** Valid commands are: ! quit ! reset [stopped] ! term ! list group "groupname" ! list disabled list alerthist list failurehist - list successes list failures list opstatus list pids list watch - stop - start loadstate ! savestate set "group" "service" "variable" "value" ! get "group" "service" "variable" ! disable service "group" "service" ! disable host "host" ["host"...] ! disable watch "watch" ! enable service "group" "service" ! enable host "host" ["host"...] ! enable watch "watch" EOF exit 0; --- 216,261 ---- Valid commands are: ! ack "watch" "service" comment ! checkauth cmd [args] ! clear "watch" "service" ! disable host "host" ["host"...] ! disable service "group" "service" ! disable watch "watch" ! dump ! enable host "host" ["host"...] ! enable service "group" "service" ! enable watch "watch" ! get "group" "service" "variable" list alerthist + list aliases + list aliasgroups + list deps + list descriptions + list disabled + list dtlog list failurehist list failures + list group "groupname" list opstatus list pids + list state + list successes + list warnings list watch loadstate ! protid ! quit ! reload ! reset [stopped] [keepstate] ! savestate disabled ! servertime set "group" "service" "variable" "value" ! start ! stop ! term ! test config ! test monitor "watch" "service" ! test {alert|startupalert|upalert} "watch" "service" "retval" "period" ! version EOF exit 0; --- NEW FILE: mon.cgi --- #!/usr/bin/perl -T #!/usr/bin/perl -Tw broke when I made changes to list_dtlog that involved # submitting three commas ",,," in a row into the value of $args :( # # NAME # mon.cgi # # # DESCRIPTION # Web interface for the Mon resource monitoring system. mon.cgi # implements a significant subset of the Perl interface to Mon, which # allows administrators to quickly view the status of their network # and perform many common Mon tasks with a simple web client. # # Requires mon 0.38-21 and Mon::Client 0.11 for proper operation. # # # AUTHORS # Originally by: [...3807 lines suppressed...] # inside &moncgi_custom_commands. # # moncgi_custom_commands returns non-zero if it finds # a command to execute; } else { # All else. &setup_page("Operation Status: Summary View"); &query_opstatus("summary"); } $webpage->print("<hr>"); # # Some stuff we keep around for debugging # #print "commands is $command, args is $args<br>\n"; #DEBUG #print $webpage->dump; #DEBUG &end_page; $c->disconnect(); Index: monshow =================================================================== RCS file: /cvsroot/mon/mon/clients/monshow,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** monshow 9 Jun 2004 05:18:07 -0000 1.1.1.1 --- monshow 15 Nov 2004 14:45:17 -0000 1.2 *************** *** 584,593 **** if ($dd == 0) { ! sprintf("%02d:%02d", $hh, $mm); } else { ! sprintf("%d days, %02d:%02d", $dd, $hh, $mm); } } --- 584,593 ---- if ($dd == 0) { ! sprintf("%02d:%02d:%02d", $hh, $mm, $ss); } else { ! sprintf("%d days, %02d:%02d:%02d", $dd, $hh, $mm, $ss); } } *************** *** 1497,1504 **** # ! # 0 = nothing special ! # 1 = do not display if zero ! # 2 = do not display if eq "" # foreach my $k ( ["opstatus", "Operational Status", 0], --- 1497,1516 ---- # ! # VAR: ! # variable name from "show opstatus" ! # ! # DESCR: ! # display name for variable ! # ! # IFZERO: ! # 0 = nothing special ! # 1 = do not display if zero ! # 2 = do not display if eq "" ! # ! # TYPE: ! # s = seconds ! # b = boolean # + my ($VAR, $DESCR, $IFZERO, $TYPE) = (0..3); foreach my $k ( ["opstatus", "Operational Status", 0], *************** *** 1512,1537 **** ["first_failure", "First Failure", 2], ["failure_duration", "Failure Duration", 2], ! ["interval", "Schedule Interval", 0], ["exclude_period", "Exclude Period", 2], ["exclude_hosts", "Exclude Hosts", 2], ! ["randskew", "Random Skew", 1], ["alerts_sent", "Alerts Sent", 1], ! ["last_alert", "Last Alert", 2]) { my $v = undef; ! if ($d->{$k->[0]} ne "") { ! $v = \$d->{$k->[0]}; ! } elsif ($sref->{$k->[0]} ne "") { ! $v = \$sref->{$k->[0]}; } ! next if ($k->[2] == 1 && $$v == 0); ! next if ($k->[2] == 2 && $$v eq ""); $OUT_BUF .= <<EOF; <tr> ! <td align=right width="15%"><b>$k->[1]:</b></td> <td> $$v </td> EOF --- 1524,1571 ---- ["first_failure", "First Failure", 2], ["failure_duration", "Failure Duration", 2], ! ["interval", "Schedule Interval", 0, "s"], ["exclude_period", "Exclude Period", 2], ["exclude_hosts", "Exclude Hosts", 2], ! ["randskew", "Random Skew", 1, "s"], ["alerts_sent", "Alerts Sent", 1], ! ["last_alert", "Last Alert", 2], ! ["monitor_duration", "Monitor Execution Duration", 2, "s"], ! ["monitor_running", "Monitor currently running", 0, "b"], ! ) { my $v = undef; ! if ($d->{$k->[$VAR]} ne "") { ! $v = \$d->{$k->[$VAR]}; ! } elsif ($sref->{$k->[$VAR]} ne "") { ! $v = \$sref->{$k->[$VAR]}; } ! # ! # convert types into display form ! # ! if ($k->[$TYPE] eq "s") ! { ! if ($$v >= 0) ! { ! $$v = secs_to_hms ($$v); ! } ! } ! ! elsif ($k->[$TYPE] eq "b") ! { ! $$v = $$v == 0 ? "false" : "true"; ! } ! ! # ! # display if zero? ! # ! next if ($k->[$IFZERO] == 1 && $$v == 0); ! next if ($k->[$IFZERO] == 2 && $$v eq ""); $OUT_BUF .= <<EOF; <tr> ! <td align=right width="15%"><b>$k->[$DESCR]:</b></td> <td> $$v </td> EOF Index: monremote.pl =================================================================== RCS file: /cvsroot/mon/mon/clients/monremote.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** monremote.pl 14 Jun 2004 10:57:14 -0000 1.1 --- monremote.pl 15 Nov 2004 14:45:17 -0000 1.2 *************** *** 55,59 **** if (!defined $ARGV[0]) { ! print "Usage: monremote.pl (enable|disable) (watch <groupname>|host <hostname>|service <group> <service>)\n"; exit; } --- 55,59 ---- if (!defined $ARGV[0]) { ! print "Usage: monremote.pl (enable|disable|test) (watch <groupname>|host <hostname>|service <group> <service>)\n"; exit; } |