diff --git a/html/pages/device/overview/generic/sensor.inc.php b/html/pages/device/overview/generic/sensor.inc.php index e069666de..48895b9cb 100644 --- a/html/pages/device/overview/generic/sensor.inc.php +++ b/html/pages/device/overview/generic/sensor.inc.php @@ -9,8 +9,17 @@ if (count($sensors)) echo('
'; } else { $alert = ""; }
+ }
+
$weekly_sensor = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150";
$sensor_popup = "', LEFT);\" onmouseout=\"return nd();\">
" . $sensor['sensor_descr'] . "";
- if ($sensor['sensor_current'] >= $sensor['sensor_limit']) { $alert = '
'; } else { $alert = ""; }
-
$sensor_day = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100";
$sensor_week = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100";
$sensor_month = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100";
diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php
index 837150ca7..6567795b8 100644
--- a/includes/defaults.inc.php
+++ b/includes/defaults.inc.php
@@ -341,6 +341,20 @@ $config['allow_unauth_graphs'] = 0; # Allow graphs to be viewed by an
$config['allow_unauth_graphs_cidr'] = array(); # Allow graphs to be viewed without authorisation from certain IP ranges
$config['auth_mechanism'] = "mysql"; # Available mechanisms: mysql (default), ldap, http-auth
+### LDAP Authentication
+
+$config['auth_ldap_version'] = 3; # v2 or v3
+$config['auth_ldap_server'] = "ldap.yourserver.com";
+$config['auth_ldap_port'] = 389;
+$config['auth_ldap_prefix'] = "uid=";
+$config['auth_ldap_suffix'] = ",ou=People,dc=example,dc=com";
+$config['auth_ldap_group'] = "cn=observium,ou=groups,dc=example,dc=com";
+
+$config['auth_ldap_groupbase'] = "ou=group,dc=example,dc=com";
+$config['auth_ldap_groups']['admin']['level'] = 10;
+$config['auth_ldap_groups']['pfy']['level'] = 7;
+$config['auth_ldap_groups']['support']['level'] = 1;
+
### Sensors
$config['allow_entity_sensor']['amperes'] = 1;
@@ -393,20 +407,6 @@ $config['syslog_filter'][] = "diskio.c"; ## Ignore some crappy stuff from SNMP
$config['enable_libvirt'] = 0; # Enable Libvirt VM support
$config['libvirt_protocols'] = array("qemu+ssh","xen+ssh"); # Mechanisms used, add or remove if not using this on any of your machines.
-### LDAP Authentication
-
-$config['auth_ldap_version'] = 3; # v2 or v3
-$config['auth_ldap_server'] = "ldap.yourserver.com";
-$config['auth_ldap_port'] = 389;
-$config['auth_ldap_prefix'] = "uid=";
-$config['auth_ldap_suffix'] = ",ou=People,dc=example,dc=com";
-$config['auth_ldap_group'] = "cn=observium,ou=groups,dc=example,dc=com";
-
-$config['auth_ldap_groupbase'] = "ou=group,dc=example,dc=com";
-$config['auth_ldap_groups']['admin']['level'] = 10;
-$config['auth_ldap_groups']['pfy']['level'] = 7;
-$config['auth_ldap_groups']['support']['level'] = 1;
-
### Hardcoded ASN descriptions
$config['astext'][65332] = "Cymru FullBogon Feed";
$config['astext'][65333] = "Cymru Bogon Feed";
diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php
index 3f4fb2b3c..7cbfed11c 100644
--- a/includes/polling/functions.inc.php
+++ b/includes/polling/functions.inc.php
@@ -2,7 +2,7 @@
function poll_sensor($device, $class, $unit)
{
- global $config;
+ global $config; global $memcache;
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? AND `poller_type` = 'snmp'", array($class, $device['device_id'])) as $sensor)
{
@@ -72,7 +72,12 @@ function poll_sensor($device, $class, $unit)
log_event(ucfirst($class) . ' ' . $sensor['sensor_descr'] . " above threshold: " . $sensor_value . " $unit (> " . $sensor['sensor_limit'] . " $unit)", $device, $class, $sensor['sensor_id']);
}
- dbUpdate(array('sensor_current' => $sensor_value), 'sensors', '`sensor_class` = ? AND `sensor_id` = ?', array($class, $sensor['sensor_id']));
+ if ($config['memcached']['enable'])
+ {
+ $memcache->set('sensor-'.$sensor['sensor_id'].'-value', $sensor_value);
+ } else {
+ dbUpdate(array('sensor_current' => $sensor_value), 'sensors', '`sensor_class` = ? AND `sensor_id` = ?', array($class, $sensor['sensor_id']));
+ }
}
}
diff --git a/includes/polling/storage.inc.php b/includes/polling/storage.inc.php
index a02cf4a5c..948539795 100755
--- a/includes/polling/storage.inc.php
+++ b/includes/polling/storage.inc.php
@@ -36,8 +36,16 @@ foreach (dbFetchRows("SELECT * FROM storage WHERE device_id = ?", array($device[
rrdtool_update($storage_rrd,"N:".$storage['used'].":".$storage['free']);
- $update = dbUpdate(array('storage_used' => $storage['used'], 'storage_free' => $storage['free'], 'storage_size' => $storage['size'], 'storage_units' => $storage['units'], 'storage_perc' => $percent),
- 'storage', '`storage_id` = ?', array($storage['storage_id']));
+ if ($config['memcached']['enable'])
+ {
+ $memcache->set('storage-'.$storage['storage_id'].'-used', $storage['used']);
+ $memcache->set('storage-'.$storage['storage_id'].'-free', $storage['free']);
+ $memcache->set('storage-'.$storage['storage_id'].'-size', $storage['size']);
+ $memcache->set('storage-'.$storage['storage_id'].'-units', $storage['units']);
+ $memcache->set('storage-'.$storage['storage_id'].'-used', $percent);
+ } else {
+ $update = dbUpdate(array('storage_used' => $storage['used'], 'storage_free' => $storage['free'], 'storage_size' => $storage['size'], 'storage_units' => $storage['units'], 'storage_perc' => $percent), 'storage', '`storage_id` = ?', array($storage['storage_id']));
+ }
echo("\n");
}
diff --git a/irc.php b/irc.php
index f58b5e5e5..390067b5e 100755
--- a/irc.php
+++ b/irc.php
@@ -11,13 +11,12 @@ include_once("includes/defaults.inc.php");
include_once("config.php");
include_once("includes/functions.php");
include_once("includes/discovery/functions.inc.php");
-
include_once('Net/SmartIRC.php');
mysql_close();
# Redirect to /dev/null or logfile if you aren't using screen to keep tabs
-echo "Observer Bot Starting ...\n";
+echo "Observium Bot Starting ...\n";
echo "\n";
echo "Timestamp Command\n";
echo "----------------- ------- \n";
diff --git a/sql-schema/016.sql b/sql-schema/016.sql
index 998ba0165..800a39288 100644
--- a/sql-schema/016.sql
+++ b/sql-schema/016.sql
@@ -2,3 +2,4 @@ ALTER TABLE `vlans` ADD `vlan_type` VARCHAR( 16 ) NULL;
ALTER TABLE `vlans` CHANGE `vlan_domain` `vlan_domain` INT NULL DEFAULT NULL;
ALTER TABLE `vlans` CHANGE `vlan_descr` `vlan_name` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `vlans` ADD `vlan_mtu` INT NULL;
+ALTER TABLE `applications` ADD `app_status` VARCHAR( 8 ) NOT NULL ;