Index: scripts/agent-local/lighttpd
===================================================================
--- scripts/agent-local/lighttpd	(revision 0)
+++ scripts/agent-local/lighttpd	(revision 0)
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Script to get lighttpd stats
+
+# This script needs the mod_status module enabled in lighttpd.conf
+# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModStatus
+
+# lighttpd.conf
+# server.modules = ( ..., "mod_status", ... )
+#
+# $HTTP["remoteip"] == "127.0.0.1" {
+# status.status-url = "/server-status"
+# }
+
+#Legenda:
+#
+# connectionsp = connect | connectionsC = Close | connectionsE = hard error | connectionsk = keep-alive
+# connectionsr = read | connectionsR = read-POST | connectionsW = = write | connectionsh = handle-request
+# connectionsq = request-start | connectionsQ = request-end
+# connectionss = response-start | connectionsS = response-end
+
+WGET="/usr/bin/wget"
+
+STATUS_URL="http://127.0.0.1/server-status"
+LIGHTTPD_TEMPFILE="/tmp/lighttpd_statistics"
+ERRORS_TEMPFILE="/tmp/lighttpd_errors"
+
+USER=""
+PASSWORD=""
+
+$WGET --user=$USER --password=$PASSWORD -q -O - $STATUS_URL?auto > $LIGHTTPD_TEMPFILE
+if [ -s $LIGHTTPD_TEMPFILE ]; then
+	totalaccesses=$(grep 'Total Accesses' $LIGHTTPD_TEMPFILE | cut -d' ' -f3)
+	totalkbytes=$(grep 'Total kBytes' $LIGHTTPD_TEMPFILE | cut -d' ' -f3)
+	uptime=$(grep 'Uptime' $LIGHTTPD_TEMPFILE | cut -d' ' -f2)	
+	busyservers=$(grep 'BusyServers' $LIGHTTPD_TEMPFILE | cut -d' ' -f2)
+	idleservers=$(grep 'IdleServers' $LIGHTTPD_TEMPFILE | cut -d' ' -f2)
+	connectionsp=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o '\.' | wc -w)
+	connectionsC=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'C' | wc -w)
+	connectionsE=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'E' | wc -w)
+	connectionsk=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'k' | wc -w)
+	connectionsr=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'r' | wc -w)
+	connectionsR=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'R' | wc -w)
+	connectionsW=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'W' | wc -w)
+	connectionsh=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'h' | wc -w)
+	connectionsq=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'q' | wc -w)
+	connectionsQ=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'Q' | wc -w)
+	connectionss=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 's' | wc -w)
+	connectionsS=$(grep 'Scoreboard' $LIGHTTPD_TEMPFILE | cut -d' ' -f2 | grep -o 'S' | wc -w)
+
+	echo "<<<app-lighttpd>>>"
+    echo "totalaccesses:$totalaccesses"
+	echo "totalkbytes:$totalkbytes"
+	echo "uptime:$uptime"
+	echo "busyservers:$busyservers"
+	echo "idleservers:$idleservers"
+	echo "connectionsp:$connectionsp"
+	echo "connectionsC:$connectionsC"
+	echo "connectionsE:$connectionsE"
+	echo "connectionsk:$connectionsk"
+	echo "connectionsr:$connectionsr"
+	echo "connectionsR:$connectionsR"
+	echo "connectionsW:$connectionsW"
+	echo "connectionsh:$connectionsh"
+	echo "connectionsq:$connectionsq"
+	echo "connectionsQ:$connectionsQ"
+	echo "connectionss:$connectionss"
+	echo "connectionsS:$connectionsS"
+
+else
+echo "Can't connect to $STATUS_URL" > $ERRORS_TEMPFILE
+fi
+rm -f $LIGHTTPD_TEMPFILE
Index: includes/polling/applications/lighttpd.inc.php
===================================================================
--- includes/polling/applications/lighttpd.inc.php	(revision 0)
+++ includes/polling/applications/lighttpd.inc.php	(revision 0)
@@ -0,0 +1,79 @@
+<?php
+/*
+echo "totalaccesses:$totalaccesses"
+echo "totalkbytes:$totalkbytes"
+echo "uptime:$uptime"
+echo "busyservers:$busyservers"
+echo "idleservers:$idleservers"
+echo "connectionsp:$connectionsp"
+echo "connectionsC:$connectionsC"
+echo "connectionsE:$connectionsE"
+echo "connectionsk:$connectionsk"
+echo "connectionsr:$connectionsr"
+echo "connectionsR:$connectionsR"
+echo "connectionsW:$connectionsW"
+echo "connectionsh:$connectionsh"
+echo "connectionsq:$connectionsq"
+echo "connectionsQ:$connectionsQ"
+echo "connectionss:$connectionss"
+echo "connectionsS:$connectionsS"
+*/
+
+if (!empty($agent_data['app']['lighttpd']))
+{
+  $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lighttpd-".$app['app_id'].".rrd";
+
+$data = array(
+    'totalaccesses' => 0,
+    'totalkbytes' => 0,
+    'uptime' => 0,
+    'busyservers' => 0,
+    'idleservers' => 0,
+    'connectionsp' => 0,
+    'connectionsC' => 0,
+    'connectionsE' => 0,
+    'connectionsk' => 0,
+    'connectionsr' => 0,
+    'connectionsR' => 0,
+    'connectionsW' => 0,
+    'connectionsh' => 0,
+    'connectionsq' => 0,
+    'connectionsQ' => 0,
+    'connectionss' => 0,
+    'connectionsS' => 0,
+  );
+
+  $lines = explode("\n", $agent_data['app']['lighttpd']);
+  foreach ($lines as $line)
+  {
+    list($key, $val) = explode(":", $line);
+    $data[trim($key)] = intval(trim($val));
+  }
+
+  if (!is_file($rrd_filename))
+  {
+    rrdtool_create($rrd_filename, " \
+        DS:totalaccesses:COUNTER:600:0:125000000000 \
+        DS:totalkbytes:COUNTER:600:0:125000000000 \
+        DS:uptime:GAUGE:600:0:125000000000 \
+        DS:busyservers:GAUGE:600:0:125000000000 \
+        DS:idleservers:GAUGE:600:0:125000000000 \
+        DS:connectionsp:GAUGE:600:0:125000000000 \
+        DS:connectionsC:GAUGE:600:0:125000000000 \
+        DS:connectionsE:GAUGE:600:0:125000000000 \
+        DS:connectionsk:GAUGE:600:0:125000000000 \
+        DS:connectionsr:GAUGE:600:0:125000000000 \
+        DS:connectionsR:GAUGE:600:0:125000000000 \
+        DS:connectionsW:GAUGE:600:0:125000000000 \
+        DS:connectionsh:GAUGE:600:0:125000000000 \
+        DS:connectionsq:GAUGE:600:0:125000000000 \
+        DS:connectionsQ:GAUGE:600:0:125000000000 \
+        DS:connectionss:GAUGE:600:0:125000000000 \
+        DS:connectionsS:GAUGE:600:0:125000000000 " );
+  }
+
+  rrdtool_update($rrd_filename,  "N:$data[totalaccesses]:$data[totalkbytes]:$data[uptime]:$data[busyservers]:$data[idleservers]:$data[connectionsp]:$data[connectionsC]:$data[connectionsE]:$data[connectionsk]:$data[connectionsr]:$data[connectionsR]:$data[connectionsW]:$data[connectionsh]:$data[connectionsq]:$data[connectionsQ]:$data[connectionss]:$data[connectionsS]");
+
+}
+
+?>
Index: html/pages/device/apps/lighttpd.inc.php
===================================================================
--- html/pages/device/apps/lighttpd.inc.php	(revision 0)
+++ html/pages/device/apps/lighttpd.inc.php	(revision 0)
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Observium
+ *
+ *   This files is part of Observium.
+ *
+ * @package    observium
+ * @subpackage applications
+ * @copyright  (C) 2006 - 2013 Adam Armstrong
+ *
+ */
+
+
+$app_graphs['default'] = array('lighttpd_hits' => 'Hits',
+                'lighttpd_traffic' => 'Traffic',
+                'lighttpd_uptime' => 'Lighttpd Uptime',
+                'lighttpd_servers' => 'Busy / Idle Workers',
+                'lighttpd_scoreboardstatistics' => 'Scoreboard Statistics');
Index: html/includes/graphs/application/lighttpd_hits.inc.php
===================================================================
--- html/includes/graphs/application/lighttpd_hits.inc.php	(revision 0)
+++ html/includes/graphs/application/lighttpd_hits.inc.php	(revision 0)
@@ -0,0 +1,27 @@
+<?php
+
+$scale_min = 0;
+
+include("includes/graphs/common.inc.php");
+
+$colour_area = "B0C4DE";
+$colour_line = "191970";
+#$colour_area_max = "FFEE99";
+$colour_area_max = "B0C4DE";
+
+$lighttpd_rrd   = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lighttpd-".$app['app_id'].".rrd";
+
+if (is_file($lighttpd_rrd))
+{
+  $rrd_filename = $lighttpd_rrd;
+}
+
+$ds = "totalaccesses";
+
+$graph_max = 1;
+
+$unit_text = "Hits/Sec";
+
+include("includes/graphs/generic_simplex.inc.php");
+
+?>

Property changes on: html/includes/graphs/application/lighttpd_hits.inc.php
___________________________________________________________________
Added: svn:executable
   + *

Index: html/includes/graphs/application/lighttpd_traffic.inc.php
===================================================================
--- html/includes/graphs/application/lighttpd_traffic.inc.php	(revision 0)
+++ html/includes/graphs/application/lighttpd_traffic.inc.php	(revision 0)
@@ -0,0 +1,28 @@
+<?php
+
+$scale_min = 0;
+
+include("includes/graphs/common.inc.php");
+
+$lighttpd_rrd   = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lighttpd-".$app['app_id'].".rrd";
+
+if (is_file($lighttpd_rrd))
+{
+  $rrd_filename = $lighttpd_rrd;
+}
+
+$ds = "totalkbytes";
+
+$colour_area = "CDEB8B";
+$colour_line = "006600";
+
+$colour_area_max = "FFEE99";
+
+$graph_max = 1;
+$multiplier = 8;
+
+$unit_text = "Kbps";
+
+include("includes/graphs/generic_simplex.inc.php");
+
+?>

Property changes on: html/includes/graphs/application/lighttpd_traffic.inc.php
___________________________________________________________________
Added: svn:executable
   + *

Index: html/includes/graphs/application/lighttpd_servers.inc.php
===================================================================
--- html/includes/graphs/application/lighttpd_servers.inc.php	(revision 0)
+++ html/includes/graphs/application/lighttpd_servers.inc.php	(revision 0)
@@ -0,0 +1,31 @@
+<?php
+
+include("includes/graphs/common.inc.php");
+
+$colours      = "mixed";
+$nototal      = (($width<224) ? 1 : 0);
+$unit_text    = "Servers";
+$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lighttpd-".$app['app_id'].".rrd";
+
+$array = array(
+               'busyservers' => array('descr' => 'Busy Workers'),
+               'idleservers' => array('descr' => 'Idle Workers'),
+               );
+$i = 0;
+
+if (is_file($rrd_filename))
+{
+    foreach ($array as $ds => $data)
+    {
+        $rrd_list[$i]['filename'] = $rrd_filename;
+        $rrd_list[$i]['descr']    = $data['descr'];
+        $rrd_list[$i]['ds']       = $ds;
+        $i++;
+    }
+} else {
+    echo("file missing: $file");
+}
+
+include("includes/graphs/generic_multi_line.inc.php");
+
+?>
Index: html/includes/graphs/application/lighttpd_uptime.inc.php
===================================================================
--- html/includes/graphs/application/lighttpd_uptime.inc.php	(revision 0)
+++ html/includes/graphs/application/lighttpd_uptime.inc.php	(revision 0)
@@ -0,0 +1,37 @@
+<?php
+
+$scale_min = 0;
+include("includes/graphs/common.inc.php");
+
+$colour_area     = "EEEEEE";
+$colour_line     = "36393D";
+$colour_area_max = "FFEE99";
+$graph_max       = 0;
+$unit_text       = "Seconds";
+
+$lighttpd_rrd   = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lighttpd-".$app['app_id'].".rrd";
+
+if (is_file($lighttpd_rrd))
+{
+  $rrd_filename = $lighttpd_rrd;
+}
+
+$ds = "uptime";
+
+$rrd_options   .= " DEF:uptime=".$rrd_filename.":uptime:AVERAGE";
+$rrd_options   .= " CDEF:cuptime=uptime,86400,/";
+
+if ($width<224)
+{
+  $rrd_options .= " 'COMMENT:Days         Cur      Min     Max     Avg\\n'";
+} else {
+  $rrd_options .= " 'COMMENT:Days      Current  Minimum  Maximum  Average\\n'";
+}
+
+$rrd_options   .= " AREA:cuptime#".$colour_area.":";
+$rrd_options   .= " LINE1.25:cuptime#".$colour_line.":Uptime";
+$rrd_options   .= " GPRINT:cuptime:LAST:%6.2lf";
+$rrd_options   .= " GPRINT:cuptime:AVERAGE:%6.2lf";
+$rrd_options   .= " GPRINT:cuptime:MAX:%6.2lf";
+$rrd_options   .= " GPRINT:cuptime:AVERAGE:%6.2lf\\n";
+?>

Property changes on: html/includes/graphs/application/lighttpd_uptime.inc.php
___________________________________________________________________
Added: svn:executable
   + *

Index: html/includes/graphs/application/lighttpd_scoreboardstatistics.inc.php
===================================================================
--- html/includes/graphs/application/lighttpd_scoreboardstatistics.inc.php	(revision 0)
+++ html/includes/graphs/application/lighttpd_scoreboardstatistics.inc.php	(revision 0)
@@ -0,0 +1,42 @@
+<?php
+
+$scale_min = 0;
+
+include("includes/graphs/common.inc.php");
+
+$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lighttpd-".$app['app_id'].".rrd";
+
+$array = array('connectionsp' => array('descr' => 'Connect', 'colour' => '750F7DFF'),
+               'connectionsC' => array('descr' => 'Close', 'colour' => '00FF00FF'),
+               'connectionsE' => array('descr' => 'Hard Error', 'colour' => '4444FFFF'),
+               'connectionsk' => array('descr' => 'Keep-alive', 'colour' => '157419FF'),
+               'connectionsr' => array('descr' => 'Read', 'colour' => 'FF0000FF'),
+               'connectionsR' => array('descr' => 'Read-POST', 'colour' => '6DC8FEFF'),
+               'connectionsW' => array('descr' => 'Write', 'colour' => 'FFAB00FF'),
+               'connectionsh' => array('descr' => 'Handle-request', 'colour' => 'FFFF00FF'),
+               'connectionsq' => array('descr' => 'Request-start', 'colour' => 'FF5576FF'),
+               'connectionsQ' => array('descr' => 'Request-end', 'colour' => 'FF3005FF'),
+               'connectionss' => array('descr' => 'Response-start', 'colour' => '800080'),
+               'connectionsS' => array('descr' => 'Response-end', 'colour' => '959868'),
+);
+
+$i = 0;
+if (is_file($rrd_filename))
+{
+  foreach ($array as $ds => $data)
+  {
+    $rrd_list[$i]['filename'] = $rrd_filename;
+    $rrd_list[$i]['descr'] = $data['descr'];
+    $rrd_list[$i]['ds'] = $ds;
+    $rrd_list[$i]['colour'] = $data['colour'];
+    $i++;
+  }
+} else { echo("file missing: $file");  }
+
+$colours   = "mixed";
+$nototal   = 1;
+$unit_text = "Workers";
+
+include("includes/graphs/generic_multi_simplex_seperated.inc.php");
+
+?>

Property changes on: html/includes/graphs/application/lighttpd_scoreboardstatistics.inc.php
___________________________________________________________________
Added: svn:executable
   + *

Index: includes/definitions/apps.inc.php
===================================================================
--- includes/definitions/apps.inc.php	(revision 4958)
+++ includes/definitions/apps.inc.php	(working copy)
@@ -20,6 +20,16 @@
 $config['app']['exim-mailqueue']['top']    = array('total');
 $config['app']['zimbra']['top']            = array('threads','mtaqueue','fdcount');
 $config['app']['crashplan']['top']         = array('bits', 'sessions', 'archivesize', 'disk');
 $config['app']['asterisk']['top'] 	   = array('peers', 'activecall');
+$config['app']['lighttpd']['top'] 	   = array('hits', 'traffic', 'servers', 'scoreboardstatistics');
 
 // End application definitions
Index: html/images/icons/lighttpd.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: html/images/icons/lighttpd.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

