2002-11-21 18:36:03 +00:00
|
|
|
|
2002-03-11 13:49:50 +00:00
|
|
|
/**
|
|
|
|
* prints session- and thread-stats for mrtg-tool
|
|
|
|
* doesn't check username or password, so that we don't have
|
2002-11-21 18:36:03 +00:00
|
|
|
* to write them cleartext in a mrtg-configfile but checks the
|
|
|
|
* remote address.
|
2002-03-11 13:49:50 +00:00
|
|
|
*/
|
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
if ( checkAddress()==false )
|
|
|
|
return;
|
2002-03-11 13:49:50 +00:00
|
|
|
|
|
|
|
if ( this.isActive()==false ) {
|
|
|
|
res.write ( "0\n0\n0\n0\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
if (req.data.action=="sessions") {
|
2002-03-11 13:49:50 +00:00
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
res.write (this.sessions.size());
|
|
|
|
res.write ("\n0\n0\n0\n");
|
|
|
|
|
|
|
|
} else if (req.data.action=="threads") {
|
|
|
|
|
|
|
|
res.write (this.countActiveEvaluators () + "\n");
|
|
|
|
res.write (this.countEvaluators () + "\n");
|
|
|
|
res.write ("0\n0\n");
|
|
|
|
|
|
|
|
} else if (req.data.action=="cache") {
|
|
|
|
|
|
|
|
res.write (this.getCacheUsage () + "\n");
|
|
|
|
res.write (this.getProperty ("cachesize", "1000") + "\n");
|
|
|
|
res.write ("0\n0\n");
|
|
|
|
|
|
|
|
} else if (req.data.action=="requests") {
|
|
|
|
|
|
|
|
// res.write (
|
|
|
|
|
|
|
|
} else {
|
|
|
|
res.write ( "0\n0\n0\n0\n");
|
2002-03-11 13:49:50 +00:00
|
|
|
}
|
|
|
|
|
2002-11-21 18:36:03 +00:00
|
|
|
|