add mail counter to a daily total
Moderators: Developers, Moderators
add mail counter to a daily total
Hi
ich have a graph which shows the mail traffic on our mailserver.
Is it possible to add a "Graph Item Type" which show the total mails
processed in the last 24 hour?
Thanks Hans
ich have a graph which shows the mail traffic on our mailserver.
Is it possible to add a "Graph Item Type" which show the total mails
processed in the last 24 hour?
Thanks Hans
- Attachments
-
- MailScanner.png (9.46 KiB) Viewed 3472 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please follow instructions of "Bandwidth Summation" at http://www.cacti.net/downloads/docs/htm ... _VARIABLES
Reinhard
Reinhard
I tried the |sum:0:current:0:auto| in the Text Format Field
but it seem to me that the resulting value is
"sum of mail * 300" . I have 11 incomming mails
but the total is 3300. Why?
5min => 300sec * 11 mails /sec = 3300 mails ?
Who can i divert it through 300
but it seem to me that the resulting value is
"sum of mail * 300" . I have 11 incomming mails
but the total is 3300. Why?
5min => 300sec * 11 mails /sec = 3300 mails ?
Who can i divert it through 300
- Attachments
-
- Graph
- sum.png (4.15 KiB) Viewed 3435 times
-
- Config
- sum2.png (34.55 KiB) Viewed 3435 times
I'm wanting to do the same thing for several data sources on one graph. It would be nice if there was a CDEF function for the selected data source(in graph templates), but I don't know if that is possible. That was a nice discovery of the 300 multiple hansklose. If the CDEF function is possible, could someone provide a way of doing it?
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please post the whole rrdtool graph statement found when clicking the graph and then one of the wrenches.hansklose wrote:I tried the |sum:0:current:0:auto| in the Text Format Field
but it seem to me that the resulting value is
"sum of mail * 300" . I have 11 incomming mails
but the total is 3300. Why?
5min => 300sec * 11 mails /sec = 3300 mails ?
Who can i divert it through 300
Reinhard
Hi
maybe i use the wrong kind of data source.
When cacti reads the counter it will be resettet to zero. I found in the
documentation that for this kind ouf data the "absolute" schould be
the right one. But when i take that i see 44.33 m Mails but we don't
send half mails so i choose gauge and the Values are right.
here is the output:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title=" MailScanner Mails In/Rejected/Spam" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
DEF:a="/var/www/tpadmin.thinprint.de/cacti/rra/thcmail01_snmp_incommingmails_246.rrd":snmp_incommingMails:AVERAGE \
AREA:a#00FF00:"Incomming Mails" \
GPRINTLAST:"Current\:%8.0lf" \
GPRINTAVERAGE:"Average\:%8.0lf" \
GPRINTMAX:"Maximum\:%8.0lf" \
GPRINTAVERAGE:"Total\: 469717%8.0lf\n"
Sometimes i see a leadig number at the end (picture).
Where does that come from?
Thanks Hans
maybe i use the wrong kind of data source.
When cacti reads the counter it will be resettet to zero. I found in the
documentation that for this kind ouf data the "absolute" schould be
the right one. But when i take that i see 44.33 m Mails but we don't
send half mails so i choose gauge and the Values are right.
here is the output:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title=" MailScanner Mails In/Rejected/Spam" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
DEF:a="/var/www/tpadmin.thinprint.de/cacti/rra/thcmail01_snmp_incommingmails_246.rrd":snmp_incommingMails:AVERAGE \
AREA:a#00FF00:"Incomming Mails" \
GPRINTLAST:"Current\:%8.0lf" \
GPRINTAVERAGE:"Average\:%8.0lf" \
GPRINTMAX:"Maximum\:%8.0lf" \
GPRINTAVERAGE:"Total\: 469717%8.0lf\n"
Sometimes i see a leadig number at the end (picture).
Where does that come from?
Thanks Hans
- Attachments
-
- sum03.png (4.69 KiB) Viewed 3417 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
You do not use CDEFs, currently. But remember, that rrdtool always stores rates. So the number graphed is the value retrieved after a 5 min polling interval divided by 300 to form a rate (per second). Actually, you suppressed the decimals by providing a 8.0 printf statement.
Assuming, you do not want to print the number of mails sent per second but per minute, you will have to apply a CDEF to those graph items. You may call it Make per Minute and it would read cdef=CURRENT_DATA_SOURCE,60,*. If you want to see per 5 min, you'd better change 60 to 300 instead.
Now I hope that numbers will fit better
Reinhard
Assuming, you do not want to print the number of mails sent per second but per minute, you will have to apply a CDEF to those graph items. You may call it Make per Minute and it would read cdef=CURRENT_DATA_SOURCE,60,*. If you want to see per 5 min, you'd better change 60 to 300 instead.
Now I hope that numbers will fit better
Reinhard
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Wrong. My instructions only deal with the "original" graph items, not the totalling one. That is: they will correct the display for the AREA and for the GPRINTs as well. So you will see the correct numbers of mail on your graph (per minute). Totaling will be left unchanged.hansklose wrote:Ok this Graph display a hole day. So I must use
cdef=CURRENT_DATA_SOURCE,86400,*
right?
Reinhard
Hi
i found a way to make it working for me!
I followed this post
http://forums.cacti.net/viewtopic.php?t ... =summation
and did at the end of the new function
$summation = $summation /300;
Now it looks like this.
Hans
i found a way to make it working for me!
I followed this post
http://forums.cacti.net/viewtopic.php?t ... =summation
and did at the end of the new function
$summation = $summation /300;
Now it looks like this.
Hans
- Attachments
-
- sum02.png (35.69 KiB) Viewed 3373 times
-
- sum05.png (3.66 KiB) Viewed 3373 times
Yes, I've seen that fix you found. I didn't want to do that because if we upgrade cacti that "fix" goes away and would have to be re-done each time. Kind of a pain. It seems to me that there should be a way to have cacti total a single value in an rrd file for the span of the graph. I would rather be able to add something like a CDEF function to do the calculation. Much like the one which totals all data sources, but have it only total the selected data source in a graph template. If someone can confirm that this cannot be done, I will have to use the "fix" noted above.
Who is online
Users browsing this forum: No registered users and 2 guests