diff --git a/cron-hourly.sh b/cron-hourly.sh index 8df41b1dd9..42a61577b1 100755 --- a/cron-hourly.sh +++ b/cron-hourly.sh @@ -1,14 +1,7 @@ #!/bin/bash +./discovery.php ./discover-cdp.php -./discover-ifs.php -./discover-nets.php -./ips.php ./cleanup.php -./discover-storage.php -./discover-temperatures.php ./generate-map.sh -./discover-cisco-temp.php -./discover-vlans.php ./update-interface.php ./check-errors.php -./discover-cisco-physical.php diff --git a/generate-map.sh b/generate-map.sh index 3a07e6a0ba..db72a0ac75 100755 --- a/generate-map.sh +++ b/generate-map.sh @@ -1,4 +1,4 @@ #!/bin/bash ./map.php > map.dot && unflatten -l5 -f map.dot | fdp -Tpng -o html/network-big.png && convert -resize 400x500 html/network-big.png html/network.png -#./map.php > map.dot && unflatten -l5 -f map.dot | circo -Tpng -o html/network-big.png && convert -resize 400x500 html/network-big.png html/network.png +./map.php > map.dot && unflatten -l5 -f map.dot | circo -Tpng -o html/network-big.png && convert -resize 900x2000 html/network-big.png html/network-screen.png diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 91128bb51b..919e4276b7 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -29,6 +29,9 @@ -
  • Overview
  • + Network Map"); + } ?>
  • Eventlog
  • Syslog"); @@ -138,17 +141,44 @@ echo("
  • Storage
  • += '5') { +echo(" +
  • BGP Sessions + +
    + +
    + +
  • +"); +} + +?> + +
  • Configuration "); echo(""); echo(""); echo(""); echo(""); echo(""); ?> diff --git a/html/pages/addsrv.php b/html/pages/addsrv.php index f81219877d..a982523f50 100644 --- a/html/pages/addsrv.php +++ b/html/pages/addsrv.php @@ -10,7 +10,7 @@ if($_POST['addsrv']) { } } -if ($handle = opendir($installdir . "/includes/services/")) { +if ($handle = opendir($config['installdir'] . "/includes/services/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && !strstr($file, ".")) { $servicesform .= ""; diff --git a/html/pages/default.php b/html/pages/default.php index b6541d73ad..a7e2eaa240 100644 --- a/html/pages/default.php +++ b/html/pages/default.php @@ -119,20 +119,11 @@ echo("
    • My Settings
    • -
    • Change Password
    • = '10') { echo(" -

    • +

    • System Settings
    • -

    • +

    • Add User
    • Remove User
    • Edit User
    • "); diff --git a/html/includes/topnav.inc b/html/includes/topnav.inc index 4a4335cc83..bbb5710f3e 100644 --- a/html/includes/topnav.inc +++ b/html/includes/topnav.inc @@ -5,17 +5,20 @@ if($_SESSION['userlevel'] >= '5') { $devices['count'] = mysql_result(mysql_query("SELECT count(*) FROM devices"),0); $devices['up'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE status = '1' AND `ignore` = '0'"),0); $devices['down'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE status = '0' AND `ignore` = '0'"),0); -$devices['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE `ignore` = '1'"),0); +$devices['ignored'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE `ignore` = '1'"),0); +$devices['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM devices WHERE `disabled` = '1'"),0); $interfaces['count'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces"),0); $interfaces['up'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifOperStatus = 'up'"),0); -$interfaces['down'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifOperStatus = 'down' AND ifAdminStatus = 'up'"),0); -$interfaces['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifAdminStatus = 'down'"),0); +$interfaces['down'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifOperStatus = 'down' AND ifAdminStatus = 'up' AND `ignore` = '0'"),0); +$interfaces['shutdown'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifAdminStatus = 'down' AND `ignore` = '0'"),0); +$interfaces['ignored'] = mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE ifOperStatus = 'down' AND `ignore` = '1'"),0); $services['count'] = mysql_result(mysql_query("SELECT count(service_id) FROM services"),0); $services['up'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '1' AND service_ignore ='0'"),0); $services['down'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '0' AND service_ignore = '0'"),0); -$services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_ignore = '1'"),0); +$services['ignored'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_ignore = '1'"),0); +$services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_disabled = '1'"),0); } else { @@ -49,22 +52,26 @@ if($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['b
    Devices : $devices[count] ( $devices[up] up - $devices[down] down - $devices[disabled] ignored ) + $devices[down] down + $devices[ignored] ignored + $devices[disabled] disabled ) +
    Interfaces : $interfaces[count] ( $interfaces[up] up $interfaces[down] down - $interfaces[disabled] disabled ) + $interfaces[ignored] ignored + $interfaces[shutdown] shutdown )
    Services : $services[count] ( $services[up] up - $services[down] down - $services[disabled] ignored ) + $services[down] down + $services[ignored] ignored + $services[disabled] disabled )
    "); echo("
- "); - if($_SESSION['userlevel'] >= '5') { - echo(" -
Network Infrastructure Diagram
- Auto-generated network diagram - "); - } -?>
+ "); - diff --git a/includes/functions.php b/includes/functions.php index 55fff820d4..75d368f0fb 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -254,7 +254,7 @@ $type = strtolower($data['os']); function delHost($id) { - global $rrd_dir; + global $config; $host = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '$id'"), 0); mysql_query("DELETE FROM `devices` WHERE `device_id` = '$id'"); $int_query = mysql_query("SELECT * FROM `interfaces` WHERE `device_id` = '$id'"); @@ -276,6 +276,7 @@ function delHost($id) { mysql_query("DELETE FROM `interfaces` WHERE `device_id` = '$id'"); mysql_query("DELETE FROM `services` WHERE `service_host` = '$id'"); mysql_query("DELETE FROM `alerts` WHERE `device_id` = '$id'"); + $rrd_dir = $config['rrd_dir']; `rm -f $rrd_dir/$host-*.rrd`; `rm -rf $rrd_dir/$host`; echo("Removed device $host
");