mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add port parser to default config, rename some stuff
git-svn-id: http://www.observium.org/svn/observer/trunk@1328 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ if($errored) { ## If there are errored ports
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
## Send the alert email
|
## Send the alert email
|
||||||
mail($config['email_default'], "Observer detected errors on $i interface" . ($i != 1 ? 's' : ''), $msg, $config['email_headers']);
|
mail($config['email_default'], "ObserverNMS detected errors on $i interface" . ($i != 1 ? 's' : ''), $msg, $config['email_headers']);
|
||||||
echo($msg);
|
echo($msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! -e /var/log/observer-mysql.pipe ]
|
if [ ! -e /var/log/observernms-mysql.pipe ]
|
||||||
then
|
then
|
||||||
mkfifo /var/log/observer-mysql.pipe
|
mkfifo /var/log/observernms-mysql.pipe
|
||||||
fi
|
fi
|
||||||
while [ -e /var/log/observer-mysql.pipe ]
|
while [ -e /var/log/observernms-mysql.pipe ]
|
||||||
do
|
do
|
||||||
mysql -u observer --password=password observer < /var/log/observer-mysql.pipe >/dev/null
|
mysql -u observernms --password=password observernms < /var/log/observernms-mysql.pipe >/dev/null
|
||||||
done
|
done
|
||||||
|
|||||||
+2
-2
@@ -9,9 +9,9 @@ include("includes/discovery/functions.inc.php");
|
|||||||
$start = utime();
|
$start = utime();
|
||||||
$runtime_stats = array();
|
$runtime_stats = array();
|
||||||
|
|
||||||
### Observer Device Discovery
|
### ObserverNMS Device Discovery
|
||||||
|
|
||||||
echo("Observer v".$config['version']." Discovery\n\n");
|
echo("ObserverNMS v".$config['version']." Discovery\n\n");
|
||||||
|
|
||||||
$options = getopt("h:t:i:n:d::a::");
|
$options = getopt("h:t:i:n:d::a::");
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ $config['overview_show_sysDescr'] = true;
|
|||||||
## Poller Modules
|
## Poller Modules
|
||||||
|
|
||||||
$config['enable_port_Xbcmc'] = 1; # Enable ifXEntry broadcast/multicast
|
$config['enable_port_Xbcmc'] = 1; # Enable ifXEntry broadcast/multicast
|
||||||
|
$config['port_descr_parser'] = "includes/port-descr-parser.inc.php"; # Parse port descriptions into fields
|
||||||
|
|
||||||
|
|
||||||
### Ignores & Allows
|
### Ignores & Allows
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include_once("Net/IPv4.php");
|
include_once("Net/IPv4.php");
|
||||||
include_once("Net/IPv6.php");
|
include_once("Net/IPv6.php");
|
||||||
|
|
||||||
## Observer Includes
|
## ObserverNMS Includes
|
||||||
|
|
||||||
include_once($config['install_dir'] . "/includes/common.php");
|
include_once($config['install_dir'] . "/includes/common.php");
|
||||||
include_once($config['install_dir'] . "/includes/rrdtool.inc.php");
|
include_once($config['install_dir'] . "/includes/rrdtool.inc.php");
|
||||||
|
|||||||
+4
-2
@@ -1,12 +1,14 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
### ObserverNMS Device Poller
|
||||||
|
|
||||||
include("includes/defaults.inc.php");
|
include("includes/defaults.inc.php");
|
||||||
include("config.php");
|
include("config.php");
|
||||||
include("includes/functions.php");
|
include("includes/functions.php");
|
||||||
|
|
||||||
$poller_start = utime();
|
$poller_start = utime();
|
||||||
echo("Observer Poller v".$config['version']."\n\n");
|
echo("ObserverNMS Poller v".$config['version']."\n\n");
|
||||||
|
|
||||||
$options = getopt("h:t:i:n:d::a::");
|
$options = getopt("h:t:i:n:d::a::");
|
||||||
|
|
||||||
@@ -259,7 +261,7 @@ $poller_end = utime(); $poller_run = $poller_end - $poller_start; $poller_time =
|
|||||||
|
|
||||||
$string = $argv[0] . " $doing " . date("F j, Y, G:i") . " - $polled_devices devices polled in $poller_time secs";
|
$string = $argv[0] . " $doing " . date("F j, Y, G:i") . " - $polled_devices devices polled in $poller_time secs";
|
||||||
if ($debug) echo("$string\n");
|
if ($debug) echo("$string\n");
|
||||||
shell_exec("echo '".$string."' >> ".$config['install_dir']."/observer.log"); # FIXME EWW
|
shell_exec("echo '".$string."' >> ".$config['install_dir']."/observernms.log"); # FIXME EWW
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
+2
-2
@@ -9,9 +9,9 @@ include("includes/discovery/functions.inc.php");
|
|||||||
|
|
||||||
$start = utime();
|
$start = utime();
|
||||||
|
|
||||||
### Observer Device Discovery
|
### ObserverNMS Device Discovery
|
||||||
|
|
||||||
echo("Observer v".$config['version']." Discovery\n\n");
|
echo("ObserverNMS v".$config['version']." Discovery\n\n");
|
||||||
|
|
||||||
if($argv[1] == "--device" && $argv[2]) {
|
if($argv[1] == "--device" && $argv[2]) {
|
||||||
$where = "AND `device_id` = '".$argv[2]."'";
|
$where = "AND `device_id` = '".$argv[2]."'";
|
||||||
|
|||||||
+2
-2
@@ -9,9 +9,9 @@ $debug =1;
|
|||||||
|
|
||||||
$poller_start = utime();
|
$poller_start = utime();
|
||||||
|
|
||||||
### Observer Device Polling Test
|
### ObserverNMS Device Polling Test
|
||||||
|
|
||||||
echo("Observer v".$config['version']." Discovery\n\n");
|
echo("ObserverNMS v".$config['version']." Discovery\n\n");
|
||||||
|
|
||||||
if($argv[1] == "--device" && $argv[2]) {
|
if($argv[1] == "--device" && $argv[2]) {
|
||||||
$where = "AND `device_id` = '".$argv[2]."'";
|
$where = "AND `device_id` = '".$argv[2]."'";
|
||||||
|
|||||||
Reference in New Issue
Block a user