Script returns 0, CACTI2RRD stores U/NaN

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
paritybit
Posts: 3
Joined: Mon Nov 12, 2007 7:23 pm
Location: Melbourne, Australia

Script returns 0, CACTI2RRD stores U/NaN

Post by paritybit »

Hi, having some troubles with customs scripts that reutrn a 0 value.

I have a custom script which returns multiple values. It works no problems when the value is greater than 0, however when the value is 0, CACTI2RRD writes "NaN" to the rrd file. Im not sure why this is so, the same problem is not replicated for scripts that return a single value.

Eg: works fine when the loc_tas output is > 0:

11/13/2007 11:50:17 AM - CMDPHP: Poller[0] Host[1] DS[1636] CMD: /var/www/html/cacti/scripts/Get_SO_MLM_Report.pl, output: loc_all:198340 loc_default:4115 loc_null:167691 loc_ok:26534 loc_vic:5081 loc_sa:1865 loc_wa:3808 loc_nt:1183 loc_qld:6730 loc_nsw:7019 loc_tas:848

11/13/2007 11:50:17 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "INSERT INTO poller_output_boost (local_data_id, rrd_name, time, output) VALUES ('798','traffic_out','2007-10-15 20:16:00','0'), ('828','traffic_out','2007-10-15 20:16:16','0'), ('999','traffic_in','2007-10-15 20:17:24','19399834'), ('855','traffic_out','2007-10-15 20:16:35','403717720'), ('895','traffic_out','2007-10-15 20:16:42','3379541380'), ('744','traffic_in','2007-10-15 20:15:50','697488'), ('798','traffic_out','2007-10-15 20:16:05','0'), ('774','traffic_out','2007-10-15 20:15:47','568994164'), ('857','traffic_out','2007-10-15 20:16:29','3810028256'), ('773','traffic_out','2007-10-15 20:15:48','2934539520'), ('949','hdd_used','2007-10-15 18:26:00','U'), ('1312','ucd_memAvailSwap','2007-11-13 11:50:16','32776888'), ('861','hdd_used','2007-11-13 11:50:15','912140288'), ('1171','traffic_out','2007-11-13 11:50:14','0'), ('692','hdd_used','2007-11-13 11:50:14','2152546304'), ('861','hdd_total','2007-11-13 11:50:15','10328707072'), ('692','hdd_total','2007-11-13 11:50:14','5286735872'), ('1171','traffic_in','2007-11-13 11:50:14','0'), ('887','ucd_memTotalReal','2007-11-13 11:50:16','8380416'), ('1197','ucd_load5min','2007-11-13 11:50:17','0.33'), ('715','traffic_out','2007-11-13 11:50:16','3192103134'), ('1328','hdd_total','2007-11-13 11:50:16','20658193408'), ('1636','','2007-11-13 11:45:01','loc_all:198340 loc_default:4115 loc_null:167691 loc_ok:26534 loc_vic:5081 loc_sa:1865 loc_wa:3808 loc_nt:1183 loc_qld:6730 loc_nsw:7019 loc_tas:848'), ('886','ucd_memShared','2007-11-13 11:50:16','U'), ('715','traffic_in','2007-11-13 11:50:16','3432029309'), ('1196','ucd_load1min','2007-11-13 11:50:17','0.30') ON DUPLICATE KEY UPDATE output=VALUES(output)"
.
.
.
11/13/2007 11:53:30 AM - BOOST: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/ssprsdfsas001_users_by_location_1636.rrd --template loc_all:loc_default:loc_null:loc_ok:loc_vic:loc_sa:loc_wa:loc_nt:loc_qld:loc_nsw:loc_tas 1194913801:198250:4111:167610:26529:5080:1866:3808:1183:6727:7017:848 1194914101:198279:4115:167635:26529:5080:1866:3808:1183:6727:7017:848 1194914401:198309:4115:167662:26532:5080:1866:3808:1183:6729:7018:848 1194914701:198340:4115:167691:26534:5081:1865:3808:1183:6730:7019:848


Not so when the value is 0:

11/13/2007 11:10:09 AM - CMDPHP: Poller[0] Host[1] DS[1636] CMD: /var/www/html/cacti/scripts/Get_SO_MLM_Report.pl, output: loc_all:198130 loc_default:4112 lo
c_null:167500 loc_ok:26518 loc_vic:5079 loc_sa:1866 loc_wa:3806 loc_nt:1183 loc_qld:6725 loc_nsw:7011 loc_tas:0

11/13/2007 11:10:09 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (1636, '', '2007-11-13
11:05:02', 'loc_all:198130 loc_default:4112 loc_null:167500 loc_ok:26518 loc_vic:5079 loc_sa:1866 loc_wa:3806 loc_nt:1183 loc_qld:6725 loc_nsw:7011 loc_tas:0')"

11/13/2007 11:16:15 AM - BOOST: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/ssprsdfsas001_users_by_location_1636.rrd --template loc_all:loc_default:loc_null:loc_ok:loc_vic:loc_sa:loc_wa:loc_nt:loc_qld:loc_nsw:loc_tas 1194912602:198130:4112:167500:26518:5079:1866:3806:1183:6725:7011:U


This same thing happens for any custom scripts with multiple outputs. Only when a value is 0.

I have even tried setting the minimum value for the RRD to -1, still no luck.

Any thoughts?
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well before anything, edit poller.php and set the cron interval to $cron_interval = 300; and remove any other "setting's" of that variable. Then, let's see.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
paritybit
Posts: 3
Joined: Mon Nov 12, 2007 7:23 pm
Location: Melbourne, Australia

Post by paritybit »

there are no instances of the variable $cron_interval in poller.php.

Is this incorrect? I'm a bit wary of editing php files unless i really have to as this is a prod system.
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Sorry, I misread the prior post. What version of Boost?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
paritybit
Posts: 3
Joined: Mon Nov 12, 2007 7:23 pm
Location: Melbourne, Australia

Post by paritybit »

1.0 it seems...


Cacti Version - 0.8.6j
Plugin Architecture - 1.1
Poller Type - CMD.php
Server Info - Linux 2.6.9-42.ELsmp
Web Server - Apache/2.0.52 (Red Hat)
PHP - 5.2.4
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, session, pcre, SimpleXML, sockets, SPL, shmop, standard, Reflection, pspell, posix, iconv, hash, gmp, gettext, ftp, filter, exif, date, curl, ctype, calendar, bz2, zlib, openssl, apache2handler, dbase, json, ldap, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, SQLite, zip
MySQL - 4.1.20
RRDTool - 1.2.19
SNMP - 5.4.1
Plugins
  • Host Info (hostinfo - v0.1)
    Device Monitoring (monitor - v0.7)
    Large Site Performane Booster for Cacti (boost - v1.0)
    RRD Cleaner - v1.2
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Yea, hat is pretty old. 1.5 is pretty stable and 1.7 is the latest, although I have heard of problems with that release. I will be making a pass at it in a few weeks.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests