|
|
| Author |
Message |
new
Joined: 10 Dec 2007 Posts: 21
|
Posted: Wed Feb 27, 2008 12:35 pm Post subject: |
|
|
| Howie wrote: | | 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 %. |
OK, I see. Then yes, the same formula should work. What do you actually see? an error? 0? something else? |
The current values is either = 0 (when I use ALL_DATA_SOURCES_NODUPS in CDEF) or the threshold are reached for all the devices (when I use SIMILAR_DATA_SOURCES_NODUPS), independent on the value. I tried to apply the CDEF to the hdd DS and the situation is the same, so this is a general problem.
What should I change in the thold-functions? In the topic there are several patches, I tried to apply the last one that you included, it does not work, maybe because I have a linux OS, therefore I would like to include the necessary changes in the original thold-functions file. |
|
| Back to top |
|
 |
new
Joined: 10 Dec 2007 Posts: 21
|
Posted: Thu Feb 28, 2008 4:27 am Post subject: |
|
|
| Howie wrote: | | 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 %. |
OK, I see. Then yes, the same formula should work. What do you actually see? an error? 0? something else? |
Howie, I found your patch it other forum:
http://cactiusers.org/forums/topic1305.html
applied it and it works! Great! Thanks a lot! |
|
| Back to top |
|
 |
peecee
Joined: 26 Feb 2008 Posts: 44
|
Posted: Wed Mar 05, 2008 6:08 pm Post subject: |
|
|
I made the modifications to thold_functions.php and created a new cdef for Percentage. The modification is working fine, I'm getting alerts, but I'm also getting a message in my cacti log for every alert:
| Code: | | 03/05/2008 06:06:14 PM - 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 " |
Obviously something is wrong, but I'm not exactly sure where to fix it. |
|
| Back to top |
|
 |
cwahlin Cacti User
Joined: 10 Oct 2003 Posts: 87
|
Posted: Thu Mar 06, 2008 8:21 am Post subject: |
|
|
I am getting an error trying to patch thold-functions.php:
[root@cacti thold]# patch thold-functions.php hj.thold_functions.rpn.all_data_sources.patch
patching file thold-functions.php
Hunk #1 FAILED at 298.
patch: **** `<' expected at line 66 of patch
Is this patch for the newer version of thold only? I am still using 0.3.2
Carl |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Thu Mar 06, 2008 8:36 am Post subject: |
|
|
| cwahlin wrote: | I am getting an error trying to patch thold-functions.php:
[root@cacti thold]# patch thold-functions.php hj.thold_functions.rpn.all_data_sources.patch
patching file thold-functions.php
Hunk #1 FAILED at 298.
patch: **** `<' expected at line 66 of patch
Is this patch for the newer version of thold only? I am still using 0.3.2
Carl |
Yes, it's for the latest version (0.3.9). |
|
| Back to top |
|
 |
peecee
Joined: 26 Feb 2008 Posts: 44
|
Posted: Thu Mar 06, 2008 10:13 am Post subject: |
|
|
Howie,
I have been using this mod for the last few days and it seems to be working great. For an enhancement, is there a way to display the percentage in the thold tab, rather than the hdd_free (or used) instead? Obviously, right now the "Current" number being displayed is the actual number, not the percentage. If you alert on a percentage, it would be nice to display the percentage the metric is at, not the actual number.
Nice simple mod for something so useful! |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Thu Mar 06, 2008 10:27 am Post subject: |
|
|
| peecee wrote: | Howie,
I have been using this mod for the last few days and it seems to be working great. For an enhancement, is there a way to display the percentage in the thold tab, rather than the hdd_free (or used) instead? Obviously, right now the "Current" number being displayed is the actual number, not the percentage. If you alert on a percentage, it would be nice to display the percentage the metric is at, not the actual number.
Nice simple mod for something so useful! |
I see what you mean. It wouldn't be too hard to store the 'post-CDEF' value somewhere... |
|
| Back to top |
|
 |
cwahlin Cacti User
Joined: 10 Oct 2003 Posts: 87
|
Posted: Thu Mar 06, 2008 10:44 am Post subject: |
|
|
| Howie wrote: | | cwahlin wrote: | I am getting an error trying to patch thold-functions.php:
[root@cacti thold]# patch thold-functions.php hj.thold_functions.rpn.all_data_sources.patch
patching file thold-functions.php
Hunk #1 FAILED at 298.
patch: **** `<' expected at line 66 of patch
Is this patch for the newer version of thold only? I am still using 0.3.2
Carl |
Yes, it's for the latest version (0.3.9). |
I just upgraded our installation to 0.8.7b, get the new thold (and settings) and tried to run the patch again. Even downloaded the patch again to make sure... Exact same problem!!
[root@cacti thold]# patch thold_functions.php hjthold_functionsrpnall_data_sources_830.patch
(Stripping trailing CRs from patch.)
patching file thold_functions.php
Hunk #1 FAILED at 298.
patch: **** `<' expected at line 66 of patch
I don't know if it's funny, or just sad. I feel kind of stupid though as it is most likely something I did...
/Carl |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Thu Mar 06, 2008 10:47 am Post subject: |
|
|
| cwahlin wrote: |
I don't know if it's funny, or just sad. I feel kind of stupid though as it is most likely something I did...
/Carl |
It probably is something you did, but you can just sidestep the whole thing by downloading the .txt file that's prepatched, a few posts further on. Rename it to .php, and you're done. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Thu Mar 06, 2008 10:54 am Post subject: |
|
|
| Howie wrote: |
I see what you mean. It wouldn't be too hard to store the 'post-CDEF' value somewhere... |
Actually, mine already *does* show the percentage. It doesn't have a percentage sign after it, but it is the percentage and not the raw value. I don't think it's something I changed either. |
|
| Back to top |
|
 |
peecee
Joined: 26 Feb 2008 Posts: 44
|
Posted: Thu Mar 06, 2008 11:02 am Post subject: |
|
|
| Howie wrote: | | Actually, mine already *does* show the percentage. It doesn't have a percentage sign after it, but it is the percentage and not the raw value. I don't think it's something I changed either. |
Huh, in looking closer, mine does too. I thought the period was a comma. I just don't need five digits of percentage points. One would be fine... |
|
| Back to top |
|
 |
cwahlin Cacti User
Joined: 10 Oct 2003 Posts: 87
|
Posted: Thu Mar 06, 2008 2:30 pm Post subject: |
|
|
| Howie wrote: | | cwahlin wrote: |
I don't know if it's funny, or just sad. I feel kind of stupid though as it is most likely something I did...
/Carl |
It probably is something you did, but you can just sidestep the whole thing by downloading the .txt file that's prepatched, a few posts further on. Rename it to .php, and you're done. |
That worked. Now I just have to make the CDEF work
Edit: Howie, your CDEF doesn't work for me. I am getting -100. My CDEF looks like yours:
cdef=CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/
And, I am trying to use this on the SNMP based hdd_used that comes with cacti.
I don't think it likes ALL_DATA_SOURCES_NODUPS. This value does not exist for me. When I do ALL_DATA_SOURCES_NODUPS - CURRENT_DATA_SOURCE I just get a negative value of the current used disk.
/Carl |
|
| Back to top |
|
 |
lerwin
Joined: 20 Mar 2008 Posts: 9 Location: Texas
|
Posted: Thu Mar 20, 2008 11:04 am Post subject: Setting up Threshold Baby steps |
|
|
This seems to be going the direction I need, however a lack of knowledge on my side is preventing me to grasp all this. I have installed the patch to thold_functions.php. I have added CDEF as Howie stated. I still can't get multiple different HDD sizes on the same machine to show different High Thresholds. The CDEF I created does not show up on the Threshold Template I try to create. I am new to CACTI and RRD.
Cacti System:
Ubuntu 7.10
MySQL 5
PHP5
Cacti (latest and greatest)
PA (same)
Settings (same)
Thold (same)
Could someone just quickly do a step by step on what to do? People are referencing other posts, and I guess I am missing something. Cacti does 80% of what I need, the last part would be notifications and Thold has the possibility to do this.
Thank y'all for all your hard work.
Loren Erwin |
|
| Back to top |
|
 |
namiradaki
Joined: 04 Jan 2007 Posts: 10
|
Posted: Fri Apr 04, 2008 1:23 am Post subject: cdef problem |
|
|
Hi Guys,
Please help im so close!
Running latest version of everything.
When creating the cdef im not able to select it in the Threshold Template.
Fair enough.
So i updated my thold_functions.php under plugins\thold with an updated one... Still no joy.
Also im not able to use the patch because im running under windows, however this should not matter as the patch basically does what over writing the thold_functions.php does.
Any assistance would be appreciated. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Fri Apr 04, 2008 2:37 am Post subject: Re: cdef problem |
|
|
| namiradaki wrote: | Hi Guys,
Please help im so close!
Running latest version of everything.
When creating the cdef im not able to select it in the Threshold Template.
Fair enough.
So i updated my thold_functions.php under plugins\thold with an updated one... Still no joy.
Also im not able to use the patch because im running under windows, however this should not matter as the patch basically does what over writing the thold_functions.php does.
Any assistance would be appreciated. |
What does the CDEF look like? There are restrictions on which CDEFs Thold can use (from memory, I think it must contain CURRENT_DATA_SOURCE, and possibly not contain certain other things). |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|