mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
small cleanups
git-svn-id: http://www.observium.org/svn/observer/trunk@2483 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -292,13 +292,6 @@ $gentime = substr($run, 0, 5);
|
||||
echo('<br /> <br /> <br /> <br /> <div id="footer">' . (isset($config['footer']) ? $config['footer'] : ''));
|
||||
echo('<br />Powered by <a href="http://www.observium.org" target="_blank">Observium ' . $config['version']);
|
||||
|
||||
#if (file_exists('.svn/entries'))
|
||||
#{
|
||||
# $svn = File('.svn/entries');
|
||||
# echo('-SVN r' . trim($svn[3]));
|
||||
# unset($svn);
|
||||
#}
|
||||
|
||||
echo('</a>. Copyright © 2006-'. date("Y"). ' by Adam Armstrong. All rights reserved.');
|
||||
|
||||
if ($config['page_gen'])
|
||||
|
||||
@@ -29,7 +29,6 @@ unset($sep);
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
|
||||
echo('<table cellpadding="7" cellspacing="0" class="devicetable" width="100%">');
|
||||
|
||||
foreach (getlocations() as $location)
|
||||
|
||||
@@ -21,9 +21,11 @@ include_once($config['install_dir'] . "/includes/console_colour.php");
|
||||
function external_exec($command)
|
||||
{
|
||||
global $debug;
|
||||
if($debug) { echo($command."/n"); }
|
||||
|
||||
if($debug) { echo($command."\n"); }
|
||||
$output = shell_exec($command);
|
||||
if($debug) { echo($output."/n"); }
|
||||
if($debug) { echo($output."\n"); }
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -48,6 +50,7 @@ function only_alphanumeric($string)
|
||||
function logfile($string)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$fd = fopen($config['log_file'],'a');
|
||||
fputs($fd,$string . "\n");
|
||||
fclose($fd);
|
||||
@@ -120,8 +123,8 @@ function interface_errors($rrd_file, $period = '-1d') // Returns the last in/out
|
||||
function getImage($host)
|
||||
{
|
||||
## FIXME why not pass $device? (my shitty ancient code here!)
|
||||
|
||||
global $config;
|
||||
|
||||
$data = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($host));
|
||||
$type = strtolower($data['os']);
|
||||
if ($config['os'][$type]['icon'] && file_exists($config['html_dir'] . "/images/os/" . $config['os'][$type]['icon'] . ".png"))
|
||||
@@ -220,7 +223,7 @@ function addHost($host, $community = NULL, $snmpver = 'v2c', $port = '161', $tra
|
||||
}
|
||||
if (!$device_id)
|
||||
{
|
||||
/// Faild SNMP
|
||||
/// Failed SNMP
|
||||
print_error("Could not reach $host with given SNMP community");
|
||||
}
|
||||
} else {
|
||||
@@ -508,7 +511,6 @@ function log_event($text, $device = NULL, $type = NULL, $reference = NULL)
|
||||
'message' => $text);
|
||||
|
||||
dbInsert($insert, 'eventlog');
|
||||
|
||||
}
|
||||
|
||||
function notify($device,$title,$message)
|
||||
@@ -607,6 +609,7 @@ function isHexString($str)
|
||||
function include_dir($dir, $regex = "")
|
||||
{
|
||||
global $device, $config, $debug, $valid;
|
||||
|
||||
if ($regex == "")
|
||||
{
|
||||
$regex = "/\.inc\.php$/";
|
||||
@@ -664,5 +667,4 @@ function is_port_valid($port, $device)
|
||||
return $valid;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user