I'm using the mysql-cacti-templates to monitor my servers. They include a set of MongoDB templates and tools.

So, I've got these running to monitor MongoDB connections. My poller reports:

02/16/2012 06:20:58 PM - CMDPHP: Poller[0] Host[26] DS[188] CMD: /usr/bin/php -q /usr/share/cacti/scripts/ss_get_by_ssh.php --host db.live --type mongodb --items dc , output: dc:1


output: dc:1 

being the value I'm after - 1 connection.

I'm totally befuddled however in that the graphs show up with a current value of 3524!

I've checked all the bindings between the RRD files, the mapping from 'dc' to the graph etc. etc. but remain baffled as to where the hell it's getting 3524 from.

I've looked in the RRD files using the dump tool and althought I don't really understand the output, the value of 3524 is clearly visible.

Where can I look in the chain of processing to get a better handle on where this value is appearing from?


Checked the cacti log file and I see this:

02/16/2012 03:32:29 PM - CMDPHP: Poller[0] Host[23] DS[171] CMD: /usr/bin/php -q /usr/share/cacti/scripts/ss_get_by_ssh.php --host spider.live --type mongodb --items dc , output: dc:1
02/16/2012 03:32:29 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/spider_live_mongodb_cnctd_clnts_171.rrd --template MONGODB_cnctd_clnts 1329406349:3521

How on earth is it translating 1 into 1329406349:3521 ?

  • Yep, been through all that. – Ted Feb 16 '12 at 20:11
  • Can you provide an example line from your RRA dump? – thinice Feb 16 '12 at 20:58
  • Understanding how RRD stores data is difficult to get into - but you may find this useful as you continue troubleshooting: oss.oetiker.ch/rrdtool/tut/rrd-beginners.en.html – thinice Feb 16 '12 at 20:59
  • Dave, reading the above log, did you look at the script /usr/share/cacti/scripts/ss_get_by_ssh.php and seeing what it does with the given input of dc:1? It appears the this is calling /usr/bin/rrdtool update aka CACTI2RRD, right? – mbrownnyc Feb 16 '12 at 21:47

Well after wasting several hours of my life I nailed it.


"dc:1" is being is being evaluated as hexadecimal because 'dc' is 'hex'.

Crazy bit of code...

  • Sounds like it's being confused by the output:. Cacti expects field1:value1 field2:value2 ... and is seeing a field called output with a value of dc:1. – pgs Mar 28 '12 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.