Debugging Cacti

cacti

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

With

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?

Update:

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 ?

Best Answer

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

http://bugs.cacti.net/view.php?id=2063

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

Crazy bit of code...

Related Topic