I would wait until a few more people have tested it, if you are unfamiliar with Cacti.cyrill wrote:Hello !
I'm a newbie with cacti and my english is bad. Can you help me ? A new CDEF should be created ???
Can you explain me how can I created it and how it work ?
thanks for your help
Threshold with CDEF'd graphs, i.e. Disk space by percentage
Moderators: Developers, Moderators
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Here you go...mcutting wrote:Howie - do you have a patched php file for us windows uers ?
Thanks
Anyone like it in french? or COBOL?
- Attachments
-
- thold_functions.php.txt
- (36.69 KiB) Downloaded 1333 times
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
You do it as llow suggested above...ejensen wrote:ok Howie, sorry for such a newbish question, but how do i use this new functionality to alert on free space? i have replaced the original functions.php file with yours, but im unclear in how to create a threshold on free space now.
can you explain the steps i need to take? thanks so much!
There are a couple of different DS that do disk space, one does used+total and another does free+total... it works the same way though.
Create a new CDEF called "Used/Total -> Percentage" and use the following formula:
Code: Select all
CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/
If you have a DS containing hdd_free and hdd_total, then you need to create a thold on hdd_free, and the result will be against percentage FREE instead of used.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Thanks Howie, I tried those steps and Im not seeing the new CDEF when i create a threshold. I looked in the cacti log and i see the following error.
I will search the forums for a solution to this, but i wondered if it has to do with the new thold_functions file you created.
thanks, Eric
Code: Select all
02/07/2008 10:55:40 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select thold_data.cdef, thold_data.rra_id, thold_data.data_id, thold_data.lastread, thold_data.oldvalue, data_template_rrd.data_source_name as name, data_template_rrd.data_source_type_id from thold_data LEFT JOIN data_template_rrd on (data_template_rrd.id = thold_data.data_id) WHERE data_template_rrd.data_source_name != '' AND "
thanks, Eric
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
I tried this also with Howie's patched thold_functions.php. My CDEF has been created as
cdef=CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/
When I attempt to set the hdd_used DS for any of my servers, I get a "Division by zero in c:\wamp\www\cacti\plugins\thold\thold_plugins.php line 386"
Any ideas ?
cdef=CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/
When I attempt to set the hdd_used DS for any of my servers, I get a "Division by zero in c:\wamp\www\cacti\plugins\thold\thold_plugins.php line 386"
Any ideas ?
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
That kind of implies that there's only one DS in the template, because otherwise ALL_DATA_SOURCES_NODUPS-CURRENT_DATA_SOURCE wouldn't be zero... either that or my code is really broken, but that exact CDEF works for me with the HOST-MIB hard drive template.mcutting wrote:I tried this also with Howie's patched thold_functions.php. My CDEF has been created as
cdef=CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/
When I attempt to set the hdd_used DS for any of my servers, I get a "Division by zero in c:\wamp\www\cacti\plugins\thold\thold_plugins.php line 386"
Any ideas ?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Hmmm - that's the template I'm applying it against. I have this working anyway in another format. There is a post by lordzik which I used. In the end, Jimmy added the hack to the THOLD plugin, so from around 0.3.5 onwards, you only need to create the CDEF itself.
This seems to work fine.
The CDEF itself is
CURRENT_DATA_SOURCE,VALUE_OF_HDD_TOTAL,/,100,*
This seems to work fine.
The CDEF itself is
CURRENT_DATA_SOURCE,VALUE_OF_HDD_TOTAL,/,100,*
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
My solution is working for me.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Howie wrote:You do it as llow suggested above...ejensen wrote:ok Howie, sorry for such a newbish question, but how do i use this new functionality to alert on free space? i have replaced the original functions.php file with yours, but im unclear in how to create a threshold on free space now.
can you explain the steps i need to take? thanks so much!
There are a couple of different DS that do disk space, one does used+total and another does free+total... it works the same way though.
Create a new CDEF called "Used/Total -> Percentage" and use the following formula:Now you create thesholds on hdd_used, with the above CDEF applied. So what that does is: (hdd_used/((hdd_used+hdd_total)-hdd_used)) * 100Code: Select all
CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/
If you have a DS containing hdd_free and hdd_total, then you need to create a thold on hdd_free, and the result will be against percentage FREE instead of used.
Sorry, it the solution working only for the disc space? What it is necessary to do if I want to create thresholds that check for example percent of IP Usage (SNMP based data)?
I created a CDEF as it is described, added the lines corresponding to the ALL_DATA_SOURCES from Howie's patch to thold-functions.php file, then created a theshold template, applied it to the corresponding devices and it does not work. I tried to use ALL_DATA_SOURCES_NODUPS and ALL_DATA_SOURCES_DUPS and SIMILAR_DATA_SOURCES_NODUPS that seems to be added after I hve applied the patch. What else should be done?
Many thanks in advance!
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
What are you trying to calculate? For interface traffic, that formula would give you something strange like 'percentage of total traffic that is inbound'.new wrote: Sorry, it the solution working only for the disc space? What it is necessary to do if I want to create thresholds that check for example percent of IP Usage (SNMP based data)?
I created a CDEF as it is described, added the lines corresponding to the ALL_DATA_SOURCES from Howie's patch to thold-functions.php file, then created a theshold template, applied it to the corresponding devices and it does not work. I tried to use ALL_DATA_SOURCES_NODUPS and ALL_DATA_SOURCES_DUPS and SIMILAR_DATA_SOURCES_NODUPS that seems to be added after I hve applied the patch. What else should be done?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
No, it is not an interface traffic, some dhcp server gives IP adresses from the poll, I need to have threshold of percentage of given from the total.Howie wrote:What are you trying to calculate? For interface traffic, that formula would give you something strange like 'percentage of total traffic that is inbound'.new wrote: Sorry, it the solution working only for the disc space? What it is necessary to do if I want to create thresholds that check for example percent of IP Usage (SNMP based data)?
I created a CDEF as it is described, added the lines corresponding to the ALL_DATA_SOURCES from Howie's patch to thold-functions.php file, then created a theshold template, applied it to the corresponding devices and it does not work. I tried to use ALL_DATA_SOURCES_NODUPS and ALL_DATA_SOURCES_DUPS and SIMILAR_DATA_SOURCES_NODUPS that seems to be added after I hve applied the patch. What else should be done?
This is from the rrdtool graph
DEF:a="/opt/lampp/htdocs/cacti/rra/fbsr64k01_total_22994.rrd":total:AVERAGE \
DEF:b="/opt/lampp/htdocs/cacti/rra/fbsr64k01_total_22994.rrd":used:AVERAGE \
CDEF:cdeff=b,a,/,100,* \
I need to have a threshold when CDEF reaches for example 75 %.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
OK, I see. Then yes, the same formula should work. What do you actually see? an error? 0? something else?new wrote: No, it is not an interface traffic, some dhcp server gives IP adresses from the poll, I need to have threshold of percentage of given from the total.
This is from the rrdtool graph
DEF:a="/opt/lampp/htdocs/cacti/rra/fbsr64k01_total_22994.rrd":total:AVERAGE \
DEF:b="/opt/lampp/htdocs/cacti/rra/fbsr64k01_total_22994.rrd":used:AVERAGE \
CDEF:cdeff=b,a,/,100,* \
I need to have a threshold when CDEF reaches for example 75 %.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Who is online
Users browsing this forum: No registered users and 2 guests