Ceph App detected but not polled

Hello, I’m having issues with the Ceph application. It is discovered on the host but, is not being discovered/polled afterwards.

I have configured and working the ceph agent in the host using the SNMP method. I tried enabling the unix-agent as proposed in Problems with ceph application but it didn’t work, so I made a little modification to /includes/polling/applications/ceph.inc.php to get the info via SNMP, as I could debug, it expects the data from the unix-agent only.

Pre-modification outputs:

Validate:
https://paste.rs/RXF1v.txt

Discovery:
https://paste.rs/bxl7a.txt

Poller:
https://paste.rs/4lHVc.txt

This is the code I made:

librenms@nms:~$ git diff includes/polling/applications/ceph.inc.php
diff --git a/includes/polling/applications/ceph.inc.php b/includes/polling/applications/ceph.inc.php
index 55b7ea5e8..bb098f3c4 100644
--- a/includes/polling/applications/ceph.inc.php
+++ b/includes/polling/applications/ceph.inc.php
@@ -5,7 +5,16 @@ use LibreNMS\RRD\RrdDefinition;
 $name = 'ceph';
 
 if (! empty($agent_data['app'][$name])) {
-    $ceph_data = $agent_data['app'][$name];
+       $ceph_data = $agent_data['app'][$name];
+} else {
+       $options = '-Oqv';
+       $oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.4.99.101.112.104';
+       $ceph_data = snmp_get($device, $oid, $options);
+       $ceph_data = preg_replace('/^.+\n/', '', $ceph_data);
+       $ceph_data = str_replace("<<<app-ceph>>>\n", '', $ceph_data);
+}
+
+if(isset($ceph_data)){
 
     $metrics = [];
     foreach (explode('<', $ceph_data) as $section) {

And this is the after-modification poller output:
https://paste.rs/8kXmp.txt

If you agree I can make a PR, I’m not sure if I’m missing something to make it work or if there is a better way to solve it.

Thanks in advance!

1 Like

Had the same problem. The above patch makes ceph data pulled over snmp.

1 Like