mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	| @@ -10,16 +10,17 @@ if (!empty($agent_data['app'][$name])) { | ||||
|         list($section, $data) = explode('>', $section); | ||||
|  | ||||
|         if ($section == "poolstats") { | ||||
|             $rrd_name = array('app', $name, $app_id, 'pool', $pool); | ||||
|             $rrd_def = array( | ||||
|                 'DS:ops:GAUGE:600:0:U', | ||||
|                 'DS:wrbytes:GAUGE:600:0:U', | ||||
|                 'DS:rbytes:GAUGE:600:0:U' | ||||
|             ); | ||||
|  | ||||
|             foreach (explode("\n", $data) as $line) { | ||||
|                 if (empty($line)) | ||||
|                     continue; | ||||
|                 list($pool,$ops,$wrbytes,$rbytes) = explode(':', $line); | ||||
|                 $rrd_name = array('app', $name, $app_id, 'pool', $pool); | ||||
|                 $rrd_def = array( | ||||
|                     'DS:ops:GAUGE:600:0:U', | ||||
|                     'DS:wrbytes:GAUGE:600:0:U', | ||||
|                     'DS:rbytes:GAUGE:600:0:U' | ||||
|                 ); | ||||
|  | ||||
|                 print "Ceph Pool: $pool, IOPS: $ops, Wr bytes: $wrbytes, R bytes: $rbytes\n"; | ||||
|                 $fields = array( | ||||
| @@ -27,42 +28,43 @@ if (!empty($agent_data['app'][$name])) { | ||||
|                     'wrbytes' => $wrbytes, | ||||
|                     'rbytes' => $rbytes | ||||
|                 ); | ||||
|                 $tags = compact($name, $app_id, $pool, $rrd_name, $rrd_def); | ||||
|                 $tags = compact('name', 'app_id', 'pool', 'rrd_name', 'rrd_def'); | ||||
|                 data_update($device, 'app', $tags, $fields); | ||||
|             } | ||||
|         } | ||||
|         elseif ($section == "osdperformance") { | ||||
|             $rrd_name = array('app', $name, $app_id, 'osd', $osd); | ||||
|             $rrd_def = array( | ||||
|                 'DS:apply_ms:GAUGE:600:0:U', | ||||
|                 'DS:commit_ms:GAUGE:600:0:U' | ||||
|             ); | ||||
|  | ||||
|             foreach (explode("\n", $data) as $line) { | ||||
|                 if (empty($line)) | ||||
|                     continue; | ||||
|                 list($osd,$apply,$commit) = explode(':', $line); | ||||
|                 $rrd_name = array('app', $name, $app_id, 'osd', $osd); | ||||
|                 $rrd_def = array( | ||||
|                     'DS:apply_ms:GAUGE:600:0:U', | ||||
|                     'DS:commit_ms:GAUGE:600:0:U' | ||||
|                 ); | ||||
|  | ||||
|  | ||||
|                 print "Ceph OSD: $osd, Apply: $apply, Commit: $commit\n"; | ||||
|                 $fields = array( | ||||
|                     'apply_ms' => $apply, | ||||
|                     'commit_ms' => $commit | ||||
|                 ); | ||||
|                 $tags = compact($name, $app_id, $osd, $rrd_name, $rrd_def); | ||||
|                 $tags = compact('name', 'app_id', 'osd', 'rrd_name', 'rrd_def'); | ||||
|                 data_update($device, 'app', $tags, $fields); | ||||
|             } | ||||
|         } | ||||
|         elseif ($section == "df") { | ||||
|             $rrd_name = array('app', $name, $app_id, 'df', $df); | ||||
|             $rrd_def = array( | ||||
|                 'DS:avail:GAUGE:600:0:U', | ||||
|                 'DS:used:GAUGE:600:0:U', | ||||
|                 'DS:objects:GAUGE:600:0:U' | ||||
|             ); | ||||
|  | ||||
|             foreach (explode("\n", $data) as $line) { | ||||
|                 if (empty($line)) | ||||
|                     continue; | ||||
|                 list($df,$avail,$used,$objects) = explode(':', $line); | ||||
|                 $rrd_name = array('app', $name, $app_id, 'df', $df); | ||||
|                 $rrd_def = array( | ||||
|                     'DS:avail:GAUGE:600:0:U', | ||||
|                     'DS:used:GAUGE:600:0:U', | ||||
|                     'DS:objects:GAUGE:600:0:U' | ||||
|                 ); | ||||
|  | ||||
|                 print "Ceph Pool DF: $pool, Avail: $avail, Used: $used, Objects: $objects\n"; | ||||
|                 $fields = array( | ||||
| @@ -71,7 +73,7 @@ if (!empty($agent_data['app'][$name])) { | ||||
|                     'objects' => $objects | ||||
|                 ); | ||||
|  | ||||
|                 $tags = compact($name, $app_id, $df, $rrd_name, $rrd_def); | ||||
|                 $tags = compact('name', 'app_id', 'df', 'rrd_name', 'rrd_def'); | ||||
|                 data_update($device, 'app', $tags, $fields); | ||||
|             } | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user