Help getting script data into Cacti

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

Moderators: Developers, Moderators

Post Reply
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Help getting script data into Cacti

Post by chadd »

I am in need of help getting data from a script I wrote into Cacti to be graphed. I am having trouble with the concept I think. I see lots of scripts were the output is always predictable and the XML files and queries reflect that. My question is, that if I had the following input:

./redback_sub_totals.pl -i <redback IP/hostname> -u <login name> -p <login password> -c <context1>,<context2>,<context3>,<context...>

And the following output:

adsl:4340 idsl:301 iframe:18, or

bbg:238 dslam:5324, or

idsl:1324 adsl:234 dslam:123 iframe:1234, etc..

What would I do for the "Data Input Method", XML file, and Data Query?

Do I have to create a "Data Input Method" for every host, based on the number of "contexts" I am retrieving data from, or is there a way to make it modular so that I can just create one "Data Input Method", XML file, etc. And use that for all the hosts - passing the correct options on a per host bases?

If anyone can answer that question, I would also like to see how the XML file would look for such a job. Thank you for any help you can give.

-chadd.
metos
Posts: 16
Joined: Fri Mar 11, 2005 9:46 am

answer

Post by metos »

chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Thank you very much for your quick reply! I just have one more question though, and maybe it is that I am missing something, but my script output could change. In your example you have nb_connect_total and nb_connect_host. In my script, I will have any number of <contexts>:<total>. So, if I am reading this right, I would have to create a data input method for every redback and change the data input method every time I need to add or remove a context from that redback? Please help me understand. Thanks for help, and sorry for the confusion. Oh, one more thing.. I didn't see an XML file in your tutorial.. Do you need one? Thanks again,

-chadd.
metos
Posts: 16
Joined: Fri Mar 11, 2005 9:46 am

Post by metos »

If i'm right...
  • with data input method u can only have output like that: (u don't need wml file)
    data1:<value> data2:<value>
  • i'm writting a new tutorial to use data query with xml file, it is to have output like that: (it is quite like for the filesystem)
    <context>:<value1>:<value2>:<value.....
    filespace1:1500:30000
    filespace3:2500:40000
    .....
    event in that case all the description are stored in an xml file, so all (using ur word) the contexty should exist in that file, i'm not sure but u can't have dynamics variables.
in this case u'll have to describe all the items in an xml file and the result will be many graphs in the same part (like with the filesystem or when u have 2 or 4 CPU).

Metos
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Thanks a TON!! Please let me know when your tutorial is done. I am having a tough time with the standard Cacti docs. Thanks again,

-chadd.
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Any luck with that tutorial Metos?
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Metos,
I have figured out how to make it work with the script/command. It is pretty ugly (have to create a data input method, data template, and graph template for every device), but it works. I will post the scripts to the forum, in case anyone else still has SMS 1800s in there network ;-). Thanks for the help, and those tutorials may be a great help in the future to others (and me ;-). Just adding an XML file for each host is a lot cleaner than all the stuff I had to add..

-chadd.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests