mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* rework the nfsen stuff * add the new netflow stats page * update the docs for nfsen * add the functions back in * readd the defaults * rework lowest_five_minutes into lowest_time * nfsen_channel_rrds removed and will rework it in later post rewriting * rework something that accidentally got nuked in merging * rework formatting a bit * remove a accidentaly added chunk of text =^.^= * rework some tag capitalization * remove a accidentally added [ * '='=>' = '
		
			
				
	
	
		
			53 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
print_optionbar_start();
 | 
						|
 | 
						|
$link_array = array(
 | 
						|
    'page'   => 'device',
 | 
						|
    'device' => $device['device_id'],
 | 
						|
    'tab'    => 'nfsen',
 | 
						|
    );
 | 
						|
 | 
						|
echo generate_link('General', $link_array, array('nfsen' => 'general'));
 | 
						|
echo '|';
 | 
						|
echo generate_link('Stats', $link_array, array('nfsen' => 'stats'));
 | 
						|
 | 
						|
$printedChannel = false;
 | 
						|
$nfsen_hostname = nfsen_hostname($device['hostname']);
 | 
						|
foreach (\LibreNMS\Config::get('nfsen_rrds') as $nfsenDir) {
 | 
						|
    $hostDir = $nfsenDir.'/'.$nfsen_hostname.'/';
 | 
						|
    if (is_dir($hostDir)) {
 | 
						|
        $nfsenRRDchannelGlob = $hostDir.'*.rrd';
 | 
						|
        foreach (glob($nfsenRRDchannelGlob) as $nfsenRRD) {
 | 
						|
            $channel = str_replace(array($hostDir, '.rrd'), '', $nfsenRRD);
 | 
						|
 | 
						|
            if (!$printedChannel) {
 | 
						|
                echo '|Channels:';
 | 
						|
                $printedChannel = true;
 | 
						|
            } else {
 | 
						|
                echo ',';
 | 
						|
            }
 | 
						|
 | 
						|
            if ($vars['channel'] == $channel) {
 | 
						|
                $channelFilter = $hostDir.$channel.'-filter.txt';
 | 
						|
            }
 | 
						|
 | 
						|
            echo generate_link($channel, $link_array, array('nfsen' => 'channel', 'channel' => $channel));
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
print_optionbar_end();
 | 
						|
 | 
						|
if (!$vars['nfsen']) {
 | 
						|
    $vars['nfsen'] = 'general';
 | 
						|
}
 | 
						|
 | 
						|
if (is_file('includes/html/pages/device/nfsen/'.mres($vars['nfsen']).'.inc.php')) {
 | 
						|
    include 'includes/html/pages/device/nfsen/'.mres($vars['nfsen']).'.inc.php';
 | 
						|
} else {
 | 
						|
    include 'includes/html/pages/device/nfsen/general.inc.php';
 | 
						|
}
 | 
						|
 | 
						|
$pagetitle[] = 'Netflow';
 |