Re: Script returns 4 values, Plot values via MRTG/routers2?

[email protected]
Newsgroups gmane.network.mrtg.user
Message-ID <OFCE87BD74.5E99C61D-ON85257AE7.0067F9F6-85257AE7.00695083@jwpepper.com>
Hey Keith,

Here's just a thought, maybe point you in the right direction...

You could have your script take say 4 separate arguments. One argument for 
each of the values you plan to output, I 
think you said you are outputting 4 Values...?

Then You would have 4 "sections" in you .cfg File, one for each of the 
values the script outputs. Then for each "Target:" 
line you would use that specific argument to get that specific value...

For Instance, let's say your script (call it "get_cpu-usage") is printing 
CPU-Usage and the 4 Values printed are:
        Line 1 == 1-Min Avg
        Line 2 == 5-Min Avg
        Line 3 == 10-Min Avg
        Line 4 == 1-Hour Avg

So lets say that is what it prints now (above)... Now what you can do is 
change the Script to print "ONLY 1 Value/ONLY 1 Line" at a time.
So to print the 1-Minute average you call your script like this:
        /path/to/script/get_cpu-usage 1-Min

Where "1-Min" is the argument Passed...

So for each of your sections in the .cfg File, they would use one argument 
for each section's "Target:" Line

So the cfg would look something like these: (*NOTICE THE "argument" PASSED 
in BOLD)

        "Section 1 --- 1-Minute Average":

                Target[target_name]: `/path/to/script/get_cpu-usage 1-Min` 
        #*Backticks `` NOT Single Quotes ''
                Title[target_name]: CPU-Usage 1-Min Average
                :....


        "Section 2 --- 5-Minute Average":

                Target[target_name]: `/path/to/script/get_cpu-usage 5-Min`
                Title[target_name]: CPU-Usage 1-Min Average
                :....


        AND SO ON.............


Hope that helps...
If I've confused you more, just let me know and I'll try to explain a 
little better

Thanks,
Matt





From:   Keith <[email protected]>
To:     <[email protected]>
Date:   01/02/2013 01:32 PM
Subject:        [mrtg] Script returns 4 values, Plot values via 
MRTG/routers2?
Sent by:        <[email protected]>




Have a device that I cannot poll via SNMP for some values. I wrote
a little expect/shell script to get me those values.

I use small perl scripts to poll data and feed those into MRTG but
those just return two values, which are used to build graphs and
work just fine.

The expect/shell script actually returns 4 integer values.
I have read that it appears I can only use RRD and routers2 to be
able to combine and display all 4 values on a graph.

I have seen some examples of how others have done this, but the
few I have seen are polling multiple devices and combining those into
one graph.

I am polling one device that returns 4 values.

How can I create a .cfg file that can take those 4 values and create
one graph?

Thanks,
Keith



_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.