PowerMTA data query and host template

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

dduval
Posts: 2
Joined: Tue May 05, 2009 11:16 pm

Post by dduval »

Hi Guys,

I've done everything specifiec below and i am getting the same problems of the rrd files returning NaN.

The logs in Cacti come back with:

05/06/2009 02:30:01 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (12, '', '2009-05-06 14:30:00', 'U')"
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] Host[7] DS[12] CMD: /usr/bin/php -q C:/Inetpub/wwwroot/cacti/scripts/powermta.php 10.0.2.52 queue, output: U
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] Host[7] DS[12] WARNING: Result from CMD not valid. Partial Result: U
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (11, '', '2009-05-06 14:30:00', 'U')"
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] Host[7] DS[11] CMD: /usr/bin/php -q C:/Inetpub/wwwroot/cacti/scripts/powermta.php 10.0.2.52 traffic, output: U
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] Host[7] DS[11] WARNING: Result from CMD not valid. Partial Result: U
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (10, '', '2009-05-06 14:30:00', 'U')"
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] Host[7] DS[10] CMD: /usr/bin/php -q C:/Inetpub/wwwroot/cacti/scripts/powermta.php 10.0.2.52 conn, output: U
05/06/2009 02:30:01 PM - CMDPHP: Poller[0] Host[7] DS[10] WARNING: Result from CMD not valid. Partial Result: U

I'm using Cacti 0.8.7d using the cacti-0.8.7d-1.92x86.exe installer running on Windows 2003. We also use PowerMTA 3.5r6.

But when running from command prompt, all values are returned properly like the examples.

Any help would be greatly appreciated.


Thanks
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

dduval wrote:Hi Guys,

I've done everything specifiec below and i am getting the same problems of the rrd files returning NaN.

I'm using Cacti 0.8.7d using the cacti-0.8.7d-1.92x86.exe installer running on Windows 2003. We also use PowerMTA 3.5r6.

But when running from command prompt, all values are returned properly like the examples.

Any help would be greatly appreciated.

Thanks
Were you able to make it work eventually?
dduval
Posts: 2
Joined: Tue May 05, 2009 11:16 pm

Post by dduval »

No. I also tried with the updated version of Cacti and still same error so i have given up. :(
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Post examples of you manually running the script
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

BSOD2600 wrote:Post examples of you manually running the script
php powermta.php 192.168.10.11
total_out_rcp:232737 total_out_msg:231583 total_out_kb:2970425.4 total_in_rcp:252075 total_in_msg:249753 total_in_kb:3138730.2 total_gmImprinted:0 lastHr_out_rcp:22891 lastHr_out_msg:22788 lastHr_out_kb:390292.8 lastHr_in_rcp:22551 lastHr_in_msg:22388 lastHr_in_kb:390189.4 lastHr_gmImprinted:0 lastMin_out_rcp:567 lastMin_out_msg:567 lastMin_out_kb:11196.5 lastMin_in_rcp:701 lastMin_in_msg:700 lastMin_in_kb:13800.1 lastMin_gmImprinted:0 topPerHr_out_rcp:38831 topPerHr_out_msg:38391 topPerHr_out_kb:425904.2 topPerHr_in_rcp:41523 topPerHr_in_msg:40784 topPerHr_in_kb:507691.2 topPerHr_gmImprinted:0 topPerMin_out_rcp:2303 topPerMin_out_msg:2299 topPerMin_out_kb:70003.3 topPerMin_in_rcp:2587 topPerMin_in_msg:2587 topPerMin_in_kb:80889.8 topPerMin_gmImprinted:0

php powermta.php 192.168.10.11 conn
smtpIn_cur:2 smtpIn_max:200 smtpIn_top:8 smtpOut_cur:263 smtpOut_max:1000 smtpOut_top:1000

php powermta.php 192.168.10.11 resolver
namesCached:89323 queriesPending:85

php powermta.php 192.168.10.11 queue
smtp_rcp:11623 smtp_dom:3738 smtp_kb:150944.9 pipe_rcp:0 pipe_dom:0 pipe_kb:0.0 discard_rcp:0 discard_dom:0 discard_kb:0.0 file_rcp:0 file_dom:0 file_kb:0.0 gmImprinter_rcp:0 gmImprinter_dom:0 gmImprinter_kb:0.0 alias_rcp:0 alias_dom:0 alias_kb:0.0

php powermta.php 192.168.10.11 spool
initPct:100 dirs:7 files_inUse:11595 files_recycled:0 files_total:22125

I have tweaked the original templates to allow bigger values to be stored/displayed.. Nothing beyond that.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

How long does it take for those scripts to run? Could be they're timing out. You could also enable error logging in php.ini, to aid with debugging of the scripts.
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

BSOD2600 wrote:How long does it take for those scripts to run? Could be they're timing out. You could also enable error logging in php.ini, to aid with debugging of the scripts.
They execute very quickly (at least from CLI) so I do not think they timeout, but I will increase the timeout value to double check this.
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

BSOD2600 wrote:How long does it take for those scripts to run? Could be they're timing out. You could also enable error logging in php.ini, to aid with debugging of the scripts.
I can confirm that this is an issue with spine (I am using 0.8.7c). When I switch to the standard poller, graphs render correctly right away. Any idea why this is happening?

Thanks,
AL
arkade
Posts: 5
Joined: Wed Jun 27, 2007 4:58 am

Post by arkade »

Thanks for a great set of templates. They are all working for me besides the traffic displaying NaN's. The CLI output seems ok:

# php powermta.php 1.2.3.4 traffic
total_out_rcp:106159 total_out_msg:106159 total_out_kb:3225168.9 total_in_rcp:105576 total_in_msg:105576 total_in_kb:3859426.3 total_gmImprinted:0 lastHr_out_rcp:1387 lastHr_out_msg:1387 lastHr_out_kb:38381.0 lastHr_in_rcp:822 lastHr_in_msg:822 lastHr_in_kb:12814.7 lastHr_gmImprinted:0 lastMin_out_rcp:40 lastMin_out_msg:40 lastMin_out_kb:252.9 lastMin_in_rcp:19 lastMin_in_msg:19 lastMin_in_kb:114.8 lastMin_gmImprinted:0 topPerHr_out_rcp:23817 topPerHr_out_msg:23817 topPerHr_out_kb:750799.5 topPerHr_in_rcp:24248 topPerHr_in_msg:24248 topPerHr_in_kb:947943.6 topPerHr_gmImprinted:0 topPerMin_out_rcp:1885 topPerMin_out_msg:1885 topPerMin_out_kb:52206.3 topPerMin_in_rcp:2306 topPerMin_in_msg:2306 topPerMin_in_kb:62565.5 topPerMin_gmImprinted:0

Any ideas?
sys0p
Posts: 48
Joined: Sun Jan 14, 2007 3:46 pm
Location: Europe

Post by sys0p »

I am having the same issue, NA appears on the traffic graph.

running: cacti-0.8.7e4

cli works fine:
01/18/2010 06:52:10 AM - CMDPHP: Poller[0] Host[77] DS[487] CMD: /usr/bin/php -q /usr/local/share/cacti/scripts/powermta.php 38.100.201.82 traffic, output: total_out_rcp:5280595 total_out_msg:5280595 total_out_kb:31848781.0 total_in_rcp:6513531 total_in_msg:6513530 total_in_kb:34343803.9 total_gmImprinted:0 lastHr_out_rcp:673 lastHr_out_msg:673 lastHr_out_kb:7097.3 lastHr_in_rcp:260 lastHr_in_msg:260 lastHr_in_kb:5056.3 lastHr_gmImprinted:0 lastMin_out_rcp:9 lastMin_out_msg:9 lastMin_out_kb:94.5 lastMin_in_rcp:2 lastMin_in_msg:2 lastMin_in_kb:64.4 lastMin_gmImprinted:0 topPerHr_out_rcp:144894 topPerHr_out_msg:144894 topPerHr_out_kb:1020315.2 topPerHr_in_rcp:294142 topPerHr_in_msg:294142 topPerHr_in_kb:1809160.0 topPerHr_gmImprinted:0 topPerMin_out_rcp:3924 topPerMin_out_msg:3924 topPerMin_out_kb:29048.2 topPerMin_in_rcp:14834 topPerMin_in_msg:14834 topPerMin_in_kb:122964.3 topPerMin_gmImprinted:0

01/18/2010 06:52:11 AM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /usr/local/share/cacti/rra/octan_in_kb_487.rrd --template out_rcp:ou_msg:out_kb:in_rcp:in_msg:in_kb 1263826326:5280595:5280595:31848781.0:6513531:6513530:34343803.9

Anyone managed to get this working ?
sys0p
Posts: 48
Joined: Sun Jan 14, 2007 3:46 pm
Location: Europe

Post by sys0p »

It seems that the script (powermta.php) doesnt always return an integer which makes rrdupdate fail.

I have applied round() to the returned values and everything looks good.
aleu
Cacti User
Posts: 216
Joined: Mon Dec 11, 2006 10:17 am

Post by aleu »

sys0p wrote:It seems that the script (powermta.php) doesnt always return an integer which makes rrdupdate fail. I have applied round() to the returned values and everything looks good.
Are you using spine? If so, where exactly did you apply the round() function? Can you show the code prior and after the change?

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests