mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* updated nicecase function for ntp server and client app * ntp applications refactoring * removed agent for ntp-server: reported as not working * removed ntpd from agent polling. thx @murrant
		
			
				
	
	
		
			31 lines
		
	
	
		
			857 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			857 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| //NET-SNMP-EXTEND-MIB::nsExtendOutputFull."ntp-client"
 | |
| $name = 'ntp-client';
 | |
| $app_id = $app['app_id'];
 | |
| $oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.10.110.116.112.45.99.108.105.101.110.116';
 | |
| $ntpclient = snmp_get($device, $oid, '-Oqv');
 | |
| 
 | |
| echo ' '.$name;
 | |
| 
 | |
| list ($offset, $frequency, $jitter, $noise, $stability) = explode("\n", $ntpclient);
 | |
| 
 | |
| $rrd_name = array('app', $name, $app_id);
 | |
| $rrd_def = array(
 | |
|     'DS:offset:GAUGE:600:-1000:1000',
 | |
|     'DS:frequency:GAUGE:600:-1000:1000',
 | |
|     'DS:jitter:GAUGE:600:-1000:1000',
 | |
|     'DS:noise:GAUGE:600:-1000:1000',
 | |
|     'DS:stability:GAUGE:600:-1000:1000'
 | |
| );
 | |
| 
 | |
| $fields = array(
 | |
|     'offset' => $offset,
 | |
|     'frequency' => $frequency,
 | |
|     'jitter' => $jitter,
 | |
|     'noise' => $noise,
 | |
|     'stability' => $stability,
 | |
| );
 | |
| 
 | |
| $tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
 | |
| data_update($device, 'app', $tags, $fields);
 |