I've attached it to the mail (the attachment appears in the Sent item)
Anyway, it is quite short (and I admit rudimental.. :-) ). So here it is:
---------------8<-------------------8<-----------------------8<---------------------
<?
// Simple script to monitor LVS
// --liuk -at- linux.it
//
// extract vars...
$p1=$_GET['resolve_dns'];
$p2=$_GET['refresh_int'];
if($p2=="" || $p2<9) { $p2="10"; };
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html><head>
<meta http-equiv="refresh" content="<? echo $p2; ?>">
<style type="text/css"><!--
body {background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: courier;}
a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse;}
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
.vv {background-color: #cccccc; color: #000000; font-family: courier; }
i {color: #666666; background-color: #cccccc;}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px;
color: #000000;}
//--></style>
<title>Local Director Monitor</title></head>
<body><div class="center">
<table border="0" cellpadding="3" width="600">
<tr class="h"><td>
<h1 class="p">Local Director Monitor v. 1.0</h1>
</td></tr>
</table><br />
<table border="0" cellpadding="3" width="800">
<tr><td class="e">Monitor Options: </td>
<td class="v">
<form method="GET" action="">
<? if(isset($resolve_dns)) { $curr_dns="$p1"; } else { $curr_dns="1"; }; ?>
<input type="checkbox" name="resolve_dns" value="<?echo $curr_dns;?>"
<? if($p1) { echo "checked=\"checked\""; } else { $dns_flag=" -n "; }; ?>
> Resolve DNS Names -
Refresh every
<input type="text" name="refresh_int" size="2" value="<? echo $p2; ?>">
seconds -
<input type="submit" value="Update">
</form>
</td></tr>
<tr><td class="e">Active node: </td>
<td class="vv"><? passthru("hostname"); ?></td></tr>
<tr><td class="e">Status: </td>
<td class="vv"><pre><? $cmd="sudo /sbin/ipvsadm -L ".$dns_flag;
passthru($cmd); ?></pre></td></tr>
<tr><td class="e">Statistics: </td>
<td class="vv"><pre><? $cmd="sudo /sbin/ipvsadm -L --stats
".$dns_flag; passthru($cmd); ?></pre></td></tr>
<tr><td class="e">Active<br>connections: </td>
<td class="vv"><pre><? $cmd="sudo /sbin/ipvsadm -L -c ".$dns_flag;
passthru($cmd); ?></pre></td></tr>
<tr><td class="e">Rate<br>statistics: </td>
<td class="vv"><pre><? $cmd="sudo /sbin/ipvsadm -L --rate ".$dns_flag;
passthru($cmd); ?></pre></td></tr>
<tr><td class="e">Sync<br>daemon: </td>
<td class="vv"><pre><? passthru("sudo /sbin/ipvsadm -L --daemon");
?></pre></td></tr>
</table><br />
</div></body></html>
---------------8<-------------------8<-----------------------8<---------------------
Cheers,
Luca
On 12/10/05, Marcel Smeets <mpgsmeets@xxxxxxxxx> wrote:
> Luca, did you atttach the script? or is it in some place?
>
> Nice to have such a script
>
> Marcel
>
> On 10/12/05, Luca Maranzano <liuk001@xxxxxxxxx> wrote:
> >
> > I've written a simple php script to monitor the status of an LVS server.
> >
> > To use it, configure sudo in order to make the Apache user to run
> > /sbin/ipvsadm as root without password prompt.
> >
> > The CSS is derived from phpinfo() page :-)
> >
> > Enjoy,
> > Luca
> >
> >
> > _______________________________________________
> > LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> > Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> > or go to http://www.in-addr.de/mailman/listinfo/lvs-users
> >
> >
> >
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
|