monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update to wap.php script in the contrib directory


From: Martin Pala
Subject: Re: Update to wap.php script in the contrib directory
Date: Fri, 05 Oct 2007 23:32:59 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 Iceape/1.1.4 (Debian-1.1.4-1)

Thanks, patch added :)

Martin


David Fletcher wrote:
Hi,

I've just made an update to the 'wap.php' script in the contrib
directory. I should have done this ages ago when the way SYSTEM
information is presented in the XML status report changed back in Monit
version 4.4. Anyway, here's the diff to give an updated wap script for
remote status checking of monit. It's a really useful way to check
status information for just a few kB of data transfer on a mobile phone.

Best wishes,

David.

--- wap.php     2006-01-01 22:01:06.000000000 +0000
+++ wap_updated.php     2007-10-05 11:06:48.000000000 +0100
@@ -47,7 +47,7 @@
 //  This script requires PHP, and a working webserver! Tested on PHP4.
 //
 //  @author Author David Fletcher, <address@hidden>
-//  @version \$Id: wap.php,v 1.2 2004/11/20 23:49:19 hauk Exp $
+//  @version \$Id: wap.php,v 1.3 2007/10/11 23:49:19 hauk Exp $

 //Configuration data
 $addr = 'localhost';
@@ -136,6 +136,11 @@
   // Make sure we can access the path array
   global $ary_path,$service_no;

+  //Service type 5 is system information, not a standard service
+  if(isset($attrs['TYPE']) && $attrs['TYPE'] == 5){
+    $name = 'SYSTEM';
+  }
+
   // Push the tag into the array
   array_push($ary_path, $name);

@@ -235,7 +240,7 @@
 //Do outputs linked to the machine, not to a specific service

 echo '<p>'.date('H:i j-M-y').'</p>';
-echo '<p><b>Hostname</b>:
'.$data_parsed['SYSTEM']['HOSTNAME'].'<br />';
+echo '<p><b>Hostname</b>: '.$data_parsed['SYSTEM']['NAME'].'<br
/>';

 $days = floor($data_parsed['SERVER']['UPTIME']/60/60/24);
 $hours = $data_parsed['SERVER']['UPTIME']/60/60%24;


-----------------------------
address@hidden
-----------------------------


_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]