Poller result from script not valid

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
ClemensBW
Posts: 9
Joined: Mon Jan 24, 2011 2:38 am

Poller result from script not valid

Post by ClemensBW »

Hello,

Operating System: debian
Webserver: Apache 2.2.9
Cacti: 0.8.7b
Spine: 0.8.7c
Plugin Architecture: sun sparc

i've try to build a script witch request the RAS Sessions from a windows server2003 box.

Code: Select all

#!/bin/sh
echo -n 'ras1:'
var1=$(cat /usr/share/cacti/site/scripts/mdatmp | grep 'TCP-MIB::tcpConnectionState.ipv4."10.100.2.1"' | wc -l)
echo -n "$var1"
echo -n ' ras2:'
var2=$(cat /usr/share/cacti/site/scripts/mdatmp | grep 'TCP-MIB::tcpConnectionState.ipv4."10.100.1.1"' | wc -l)
echo "$var2"
output in shell:

Code: Select all

box2:/usr/share/cacti/site/scripts# perl ./ras.sh
ras1:371 ras2:79
box2:/usr/share/cacti/site/scripts#

i've setting it up to cacti, but in the weblog shows:

Code: Select all

03/03/2011 04:25:07 PM - SPINE: Poller[0] Host[38] DS[998] SCRIPT: /usr/share/cacti/site/scripts/ras.sh, output: U
03/03/2011 04:25:07 PM - SPINE: Poller[0] Host[38] DS[998] WARNING: Result from SCRIPT not valid. Partial Result: ras1...
03/03/2011 04:25:05 PM - SPINE: Poller[0] Host[37] DS[999] SCRIPT: /usr/share/cacti/site/scripts/ras.sh, output: U
03/03/2011 04:25:05 PM - SPINE: Poller[0] Host[37] DS[999] WARNING: Result from SCRIPT not valid. Partial Result: ras1... 
tail -f | grep ras on the system logfile:

Code: Select all

/usr/share/cacti/site/scripts/ras.sh: line 3: echo: write error: Broken pipe
/usr/share/cacti/site/scripts/ras.sh: line 4: echo: write error: Broken pipe
/usr/share/cacti/site/scripts/ras.sh: line 6: echo: write error: Broken pipe
/usr/share/cacti/site/scripts/ras.sh: line 3: echo: write error: Broken pipe
/usr/share/cacti/site/scripts/ras.sh: line 4: echo: write error: Broken pipe
/usr/share/cacti/site/scripts/ras.sh: line 6: echo: write error: Broken pipe
any idea why the pipe is broken?
thx
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Poller result from script not valid

Post by noname »

Perhaps that is concerned with this..
http://docs.cacti.net/manual:087:3a_advanced_topics.1_data_input_methods
Note: Spine requires, that multiple parameters are spit out by a single “print” statement. ...
Try:

Code: Select all

echo "ras1:$var1 ras2:$var2"
ClemensBW
Posts: 9
Joined: Mon Jan 24, 2011 2:38 am

Re: Poller result from script not valid

Post by ClemensBW »

hello,

Code: Select all

03/04/2011 08:40:08 AM - SPINE: Poller[0] Host[37] DS[999] SCRIPT: /usr/share/cacti/site/scripts/mda.pl, output: U
03/04/2011 08:45:08 AM - SPINE: Poller[0] Host[38] DS[998] SCRIPT: /usr/share/cacti/site/scripts/mda.pl, output: ras1:371 ras2:79
thanks a lot :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest