Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[HOWTO] Using Data Queries and Data Input Methods
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's
Author Message
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Wed Mar 01, 2006 12:12 pm    Post subject: Reply with quote

Thanks so much for this in depth write up.

I've actually taught myself how to implement cacti differently. I prefer this approach better.

My question is I have a DIM that will save 7 items. I created a graph to monitor 2 of those items and it worked great. My problem is that I created another graph to display 2 more of those items. However the .pl script is now getting called twice and creating 2 different.

How can I use this method of graphing hosts and only call my script once and have multiple graphs based on different variables returned?
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Wed Mar 01, 2006 1:48 pm    Post subject: Reply with quote

Create the first Graph as usual (from Create Graphs for this Host). The goto Graph Management and Add. Select the wanted Graph Template and Host. Next step: select the correct data sources. This will use existing data sources instead of generating new ones
Reinhard
Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Wed Mar 01, 2006 1:56 pm    Post subject: Reply with quote

Hmm I had tried that. I noticed there was 2 sets of data sources in the drop down, so I selected the opposite one. It still polled twice. I've decided for this graph to seperate it logically into their own scripts. I'll have to try again next time on a different DIM.

Thanks
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Wed Mar 01, 2006 3:05 pm    Post subject: Reply with quote

You may get rid of the duplicated rrd: Select both Data Sources and copy down the names of the according rrds. Simply replace one of the filenames by the other one. Then run php rebuild_poller_ccache.php or Clear Poller Cache
Reinhard
Back to top
Leddy
Cacti User


Joined: 15 May 2005
Posts: 67

PostPosted: Wed Mar 01, 2006 3:41 pm    Post subject: Reply with quote

I finally got it working. Not sure what I did previously. Following your steps worked great. I've just been battling "NaN"'s all day

I think recreating the Graph Template resolved that issue. Must have been a Dat Source inconsistency.

*clap* *clap*

Thanks, keep up the good work
Back to top
Geier0815



Joined: 22 May 2006
Posts: 13

PostPosted: Mon May 22, 2006 8:34 am    Post subject: Reply with quote

Hello lvm,

it's a nice HowTo you wrote, but I've got problems with it. I've created an graph for traffic but the measures seemd to be wrong. I've downloaded a 1GB File to the computer and wget told me that the average downloadrate was 4.95 MB/s. cacti shows a rate of 40k. Do you have an Idea where I can look whats going wrong?
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Mon May 22, 2006 11:18 am    Post subject: Reply with quote

First, pay attention to bits and Bytes. wget reports in Bytes, cacti (usually) in bits.
Second, pay attention to the timespan of a reading. Cacti takes its readings every 300 sec. But if you perform a download that only lasts for some seconds, during download time the traffic is high, but averaged over 300 sec it will be much lower
Reinhard
Back to top
Geier0815



Joined: 22 May 2006
Posts: 13

PostPosted: Mon May 22, 2006 12:35 pm    Post subject: Reply with quote

lvm wrote:
First, pay attention to bits and Bytes. wget reports in Bytes, cacti (usually) in bits.

In your HowTo you use ifInOctets and ifOutOctets and so do I.
Quote:
Second, pay attention to the timespan of a reading. Cacti takes its readings every 300 sec. But if you perform a download that only lasts for some seconds, during download time the traffic is high, but averaged over 300 sec it will be much lower
Reinhard

I've downloaded a 1GB File 2 times, so the download takes more than 5 minutes.
And the third point is that a graph created by 'Internet - traffic (bytes/sec)' shows exaktly the same form but right measures (nearly 3,5M) and i can't find any diffrent between the two data templates or the graph templates. I'm completely mystified.
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Tue May 23, 2006 5:09 am    Post subject: Reply with quote

Please post a screenshot of the failing Graph along with the CDEFs used within
Reinhard
Back to top
Geier0815



Joined: 22 May 2006
Posts: 13

PostPosted: Wed May 24, 2006 4:32 am    Post subject: Reply with quote

First screenshot shows the both traffic graphs when traffic is low. You see that both are equal.
The second screenshot was made after loading three times a 1GB file, you see the form of both are equal but the measures differ.

CDEFs where on both set to 'none' or you mean something that I couldn't found.



cacti_niedriger_load.jpg
 Description:
 Filesize:  74.6 KB
 Viewed:  6032 Time(s)

cacti_niedriger_load.jpg



cacti_hoher_load.jpg
 Description:
 Filesize:  67 KB
 Viewed:  6032 Time(s)

cacti_hoher_load.jpg


Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Wed May 24, 2006 12:09 pm    Post subject: Reply with quote

Please click on both graphs to see a little wrench next to the newly generated graphs. Click this to see the whole rrdtool graph statement and post both. I'll request the next step then
Reinhard
Back to top
Geier0815



Joined: 22 May 2006
Posts: 13

PostPosted: Fri May 26, 2006 1:38 am    Post subject: Reply with quote

testserver6 test-traffic:
Quote:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="testserver6 - Test-traffic" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
DEF:a="/usr/share/cacti/rra/testserver6_ifinoctets_35.rrd":ifInOctets:AVERAGE \
DEF:b="/usr/share/cacti/rra/testserver6_ifinoctets_35.rrd":ifOutOctets:AVERAGE \
LINE2:a#FF00FF:"incomming" \
LINE1:b#4123A1:"output data"


For the other graph:
Quote:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="testserver6 - Traffic - 213.178.71.76 (eth0)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
DEF:a="/usr/share/cacti/rra/testserver6_traffic_in_33.rrd":traffic_in:AVERAGE \
DEF:b="/usr/share/cacti/rra/testserver6_traffic_in_33.rrd":traffic_out:AVERAGE \
AREA:a#00CF00:"Inbound" \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A97:"Outbound" \
GPRINT:b:LAST:"Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s"
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Fri May 26, 2006 6:23 am    Post subject: Reply with quote

Would you please post a screenshot of both Data Sources like the attached?
Reinhard



Bildschirmfoto-4.png
 Description:
Data source
 Filesize:  35.16 KB
 Viewed:  5970 Time(s)

Bildschirmfoto-4.png


Back to top
Geier0815



Joined: 22 May 2006
Posts: 13

PostPosted: Fri May 26, 2006 7:56 am    Post subject: Reply with quote

Here the screenshots, first this with the wrong measures:


cacti_datasource_test_traffic.jpg
 Description:
 Filesize:  68.19 KB
 Viewed:  5963 Time(s)

cacti_datasource_test_traffic.jpg



cacti_datasource_traffic.jpg
 Description:
 Filesize:  104.04 KB
 Viewed:  5963 Time(s)

cacti_datasource_traffic.jpg


Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12275
Location: Muenster, Germany

PostPosted: Fri May 26, 2006 10:33 am    Post subject: Reply with quote

I can't make sense of it. Looks like my own stuff (that works). Is it possible to switch Settings -> Logging Level to DEBUG for one polling cycle and post the part belonging to both data templates (the polling including the OID fetched and the data returned and the "rrdtool update" part)?
Reinhard
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 



Powered by phpBB © 2001, 2005 phpBB Group