mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
smarter catos version/hardware fetcher. put software release year into $features
git-svn-id: http://www.observium.org/svn/observer/trunk@1653 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
echo("Cisco Catalyst OS\n");
|
||||||
|
|
||||||
#Cisco Systems, Inc. WS-C2948 Cisco Catalyst Operating System Software, Version 4.5(9) Copyright (c) 1995-2000 by Cisco Systems, Inc.
|
#Cisco Systems, Inc. WS-C2948 Cisco Catalyst Operating System Software, Version 4.5(9) Copyright (c) 1995-2000 by Cisco Systems, Inc.
|
||||||
#Cisco Systems WS-C5509 Cisco Catalyst Operating System Software, Version 5.5(19) Copyright (c) 1995-2003 by Cisco Systems
|
#Cisco Systems WS-C5509 Cisco Catalyst Operating System Software, Version 5.5(19) Copyright (c) 1995-2003 by Cisco Systems
|
||||||
#Cisco Systems WS-C5500 Cisco Catalyst Operating System Software, Version 5.5(18) Copyright (c) 1995-2002 by Cisco Systems
|
#Cisco Systems WS-C5500 Cisco Catalyst Operating System Software, Version 5.5(18) Copyright (c) 1995-2002 by Cisco Systems
|
||||||
@@ -14,11 +16,10 @@
|
|||||||
$hardware = $ciscomodel;
|
$hardware = $ciscomodel;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sysDescr = str_replace("IOS (tm)", "IOS (tm),", $sysDescr);
|
$sysDescr = str_replace(", Inc.", "", $sysDescr); ## Make the two formats the same
|
||||||
list(,$features,$version) = explode(",", $sysDescr);
|
$sysDescr = str_replace("\n", " ", $sysDescr);
|
||||||
$version = str_replace("Copyright", "", $version);
|
|
||||||
list(,$version,) = explode(" ", trim($version));
|
list(,,$hardware,,,,,,,$version,,,$features) = explode(" ", $sysDescr);
|
||||||
list(,$features) = explode("(", $features);
|
|
||||||
list(,$features) = explode("-", $features);
|
list(,$features) = explode("-", $features);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -154,6 +154,12 @@ while ($device = mysql_fetch_assoc($device_query))
|
|||||||
}
|
}
|
||||||
rrdtool_update($uptimerrd, "N:$uptime");
|
rrdtool_update($uptimerrd, "N:$uptime");
|
||||||
|
|
||||||
|
$graphs['uptime'] = TRUE;
|
||||||
|
|
||||||
|
echo("Uptime: ".formatUptime($uptime)."\n");
|
||||||
|
|
||||||
|
print_r($graphs);
|
||||||
|
|
||||||
$poll_update .= $poll_separator . "`uptime` = '$uptime'";
|
$poll_update .= $poll_separator . "`uptime` = '$uptime'";
|
||||||
$poll_separator = ", ";
|
$poll_separator = ", ";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user