Index: html/pages/device/apps/lvs_stats.inc.php
===================================================================
--- html/pages/device/apps/lvs_stats.inc.php	(revision 0)
+++ html/pages/device/apps/lvs_stats.inc.php	(revision 0)
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * Observium
+ *
+ *   This files is part of Observium.
+ *
+ * @package    observium
+ * @subpackage applications
+ * @copyright  (C) 2006 - 2013 Adam Armstrong
+ *
+ */
+
+
+$app_graphs['default'] = array('lvs_stats_connections' => 'Connections per Second',
+                'lvs_stats_packets' => 'Packets per Second',
+                'lvs_stats_bytes'  => 'Bytes per Second');
Index: html/images/icons/lvs_stats.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: html/images/icons/lvs_stats.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream
Index: html/includes/graphs/application/lvs_stats_bytes.inc.php
===================================================================
--- html/includes/graphs/application/lvs_stats_bytes.inc.php	(revision 0)
+++ html/includes/graphs/application/lvs_stats_bytes.inc.php	(revision 0)
@@ -0,0 +1,27 @@
+<?php
+
+$scale_min = 0;
+
+include("includes/graphs/common.inc.php");
+
+$lvs_stats_rrd   = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lvs_stats-".$app['app_id'].".rrd";
+
+if (is_file($lvs_stats_rrd))
+{
+  $rrd_filename = $lvs_stats_rrd;
+}
+
+$ds = "bytes";
+
+$colour_area = "F0E68C";
+$colour_line = "FF4500";
+
+$colour_area_max = "FFEE99";
+
+$graph_max = 1;
+
+$unit_text = "bytes/sec";
+
+include("includes/graphs/generic_simplex.inc.php");
+
+?>

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

Index: html/includes/graphs/application/lvs_stats_packets.inc.php
===================================================================
--- html/includes/graphs/application/lvs_stats_packets.inc.php	(revision 0)
+++ html/includes/graphs/application/lvs_stats_packets.inc.php	(revision 0)
@@ -0,0 +1,28 @@
+<?php
+
+$scale_min = 0;
+
+include("includes/graphs/common.inc.php");
+
+$lvs_stats_rrd   = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lvs_stats-".$app['app_id'].".rrd";
+
+if (is_file($lvs_stats_rrd))
+{
+  $rrd_filename = $lvs_stats_rrd;
+}
+
+$ds = "packets";
+
+$colour_area = "CDEB8B";
+$colour_line = "006600";
+
+#$colour_area_max = "FFEE99";
+$colour_area_max = "CDEB8B";
+
+$graph_max = 1;
+
+$unit_text = "Packets/sec";
+
+include("includes/graphs/generic_simplex.inc.php");
+
+?>

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

Index: html/includes/graphs/application/lvs_stats_connections.inc.php
===================================================================
--- html/includes/graphs/application/lvs_stats_connections.inc.php	(revision 0)
+++ html/includes/graphs/application/lvs_stats_connections.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";
+
+$lvs_stats_rrd   = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-lvs_stats-".$app['app_id'].".rrd";
+
+if (is_file($lvs_stats_rrd))
+{
+  $rrd_filename = $lvs_stats_rrd;
+}
+
+$ds = "connections";
+
+$graph_max = 1;
+
+$unit_text = "Con/sec";
+
+include("includes/graphs/generic_simplex.inc.php");
+
+?>

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

Index: includes/definitions.inc.php
===================================================================
--- includes/definitions.inc.php	(revision 4930)
+++ includes/definitions.inc.php	(working copy)
@@ -150,6 +150,9 @@
     "snmp" => "SNMP",
     "mssql" => "SQL Server",
     "apower" => "Apparent power",
+    "lvs_stats" => "LVS Stats",
     "" => "");
 
 // Routing types
Index: includes/definitions/apps.inc.php
===================================================================
--- includes/definitions/apps.inc.php	(revision 4930)
+++ includes/definitions/apps.inc.php	(working copy)
@@ -20,5 +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']['lvs_stats']['top']         = array('connections', 'packets', 'bytes');
 
 // End application definitions

Index: scripts/agent-local/lvs_stats
===================================================================
--- scripts/agent-local/lvs_stats	(revision 0)
+++ scripts/agent-local/lvs_stats	(revision 0)
@@ -0,0 +1,21 @@
+#!/bin/bash
+# http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.monitoring_lvs.html | 33.3. Monitoring: LVS director throughput statistics from the /proc system (originally /proc/net/ip_vs_stats)
+# Check your connections per second if you have a loadbalancer with keepalived.
+
+#total
+connections=$(sed -n 3p /proc/net/ip_vs_stats | awk '{print $1}')
+packets=$(sed -n 3p /proc/net/ip_vs_stats | awk '{print $2}')
+bytes=$(sed -n 3p /proc/net/ip_vs_stats | awk '{print $4}')
+
+#per second
+conspersec=$(cat /proc/net/ip_vs_stats |tail -1| awk '{print $1}')
+pktpersec=$(cat /proc/net/ip_vs_stats |tail -1| awk '{print $2}')
+bytespersec=$(cat /proc/net/ip_vs_stats |tail -1| awk '{print $4}')
+
+echo '<<<app-lvs_stats>>>'
+echo "connections_total:$((0x$connections))"
+echo "packets_total:$((0x$packets))"
+echo "bytes_total:$((0x$bytes))"
+echo "connections_sec:$((0x$conspersec))"
+echo "packets_sec:$((0x$pktpersec))"
+echo "bytes_sec:$((0x$bytespersec))"

Property changes on: scripts/agent-local/lvs_stats
___________________________________________________________________
Added: svn:executable
   + *

