Need help with Data Input/Data source

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Lasas
Posts: 3
Joined: Mon May 09, 2011 3:13 pm

Need help with Data Input/Data source

Post by Lasas »

Hello,

i'm trying to create a graph from this perl output: print "Isjungti:$Total Isviso:$Total4 Neisjunge1:$Total0 Neisjunge2:$Total1 Neisjunge3:$Total2";
prints out this: Isjungti:371 Isviso:372 Neisjunge1:14 Neisjunge2:21 Neisjunge3:15
i was following http://docs.cacti.net/manual:087:3a_adv ... ut_methods guide but something went wrong.. Problem is that i'm missing something and i cant find what.. any help would be appreciated. I think the problem is in data input or data source any suggestions? :)

EDIT:

Found my problem.. its in perl output..
05/10/2011 08:40:02 AM - SPINE: Poller[0] Host[0] DS[659] SCRIPT: /usr/bin/perl /usr/share/cacti/site/scripts/stat.pl, output: Isjungti:0 Isviso: Neisjunge1: Neisjunge2: Neisjunge3:

if i print "Isjungti:371 Isviso:372 Neisjunge1:14 Neisjunge2:21 Neisjunge3:15" from perl script it works... ;\ any suggestions on perl output format?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Need help with Data Input/Data source

Post by noname »

Lasas wrote:05/10/2011 08:40:02 AM - SPINE: Poller[0] Host[0] DS[659] SCRIPT: /usr/bin/perl /usr/share/cacti/site/scripts/stat.pl, output: Isjungti:0 Isviso: Neisjunge1: Neisjunge2: Neisjunge3:
It seems to be failed getting values except Isjungti.
Did you see such a line "WARNING: Result from SCRIPT not valid. Partial Result:..." in Cacti log?

If you use spine, check this:
http://docs.cacti.net/manual:087:3a_advanced_topics.1_data_input_methods#making_your_scripts_work_with_cacti
Note: Spine requires, that multiple parameters are spit out by a single “print” statement. ...
Lasas
Posts: 3
Joined: Mon May 09, 2011 3:13 pm

Re: Need help with Data Input/Data source

Post by Lasas »

I tried whit separate print for each value then in one line then separate with new line still no luck...
when i print values (print "Isjungti:$Total "; so on...) i get
05/10/2011 11:55:03 AM - SPINE: Poller[0] Host[0] DS[660] SCRIPT: /usr/share/cacti/site/scripts/stat.pl, output: U

i was able to get it working only when i print "Isjungti:371 Isviso:372 Neisjunge1:25 Neisjunge2:1 Neisjunge3:1"
numbers are written by me in perl script...

no warnings in log and that value of "isjungt" it should't be 0.. it should be 371 :(
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Need help with Data Input/Data source

Post by noname »

Oh sorry, you did already with single print statement.
Lasas wrote:i'm trying to create a graph from this perl output: print "Isjungti:$Total Isviso:$Total4 Neisjunge1:$Total0 Neisjunge2:$Total1 Neisjunge3:$Total2";
Then, how do you retrieve each values ($Total, $Total0, $Total1, ...) ?
If you are using external command from perl script (like system(), backquote, etc.),
try to specify them with full pathname.
Lasas
Posts: 3
Joined: Mon May 09, 2011 3:13 pm

Re: Need help with Data Input/Data source

Post by Lasas »

well stupid me :) found whats the problem... txt files with info was in /root/ dir.. moved them to /usr/share/cacti/site/scripts/ problem solved.. THX for helping :)
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests