Threshold with CDEF'd graphs, i.e. Disk space by percentage

Support questions about the Threshold plugin

Moderators: Developers, Moderators

namiradaki
Posts: 10
Joined: Thu Jan 04, 2007 7:21 pm

thold cdef problem

Post by namiradaki »

Hey Howie,

Thanks for your reply, ive actually tried to get this working via all your prior posts.

Im using the cdef you posted.

CURRENT_DATA_SOURCE,100,*,ALL_DATA_SOURCES_NODUPS,CURRENT_DATA_SOURCE,-,/

I don't think it likes the "ALL_DATA_SOURCES_NODUPS"

Regards,
Nick
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This is which version of cacti? What gives Graph templates Debug option?
Reinhard
namiradaki
Posts: 10
Joined: Thu Jan 04, 2007 7:21 pm

cdef problem

Post by namiradaki »

Hi Gandalf,

Im running Cacti Version 0.8.7b and thold Version ........ 0.3.8.

Not sure what you mean about, what gives graph template debug option.

Regards,
Nick
namiradaki
Posts: 10
Joined: Thu Jan 04, 2007 7:21 pm

Re: cdef problem

Post by namiradaki »

Howie,

I understand that you released a patch for thold_functions.php, i also saw that your released a new thold_functions.php for windows file fully patched. However it doesnt seem to work for me.

Does patching do something different from just overwriting the file. Do I need to possibly recompile thold or re run the setup.php for it?

Please any guidance would be appreciated.

Regards,
Nick
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

namiradaki wrote:Howie,

I understand that you released a patch for thold_functions.php, i also saw that your released a new thold_functions.php for windows file fully patched. However it doesnt seem to work for me.

Does patching do something different from just overwriting the file. Do I need to possibly recompile thold or re run the setup.php for it?

Please any guidance would be appreciated.

Regards,
Nick
No, it's just that patching is inconvenient for windows users. It sounds like you don't have it right though, because ALL_DATA_SOURCES_NODUPS is the one function I added :-) HOWEVER, nothing I added affects what appears in the list of CDEFs - only how the CDEF is processed.

All I can really say is that it works for me. Thold will only show cdefs in the list that contain CURRENT_DATA_SOURCE. Do you get any others? All others?
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!)
lerwin
Posts: 9
Joined: Thu Mar 20, 2008 9:40 am
Location: Texas

Threshold percentage not working

Post by lerwin »

I have thold working with standard numbers, meaning if I say alert me when the size is 72000000000, it will then alert me. However, all my servers have multiple drives of different sizes. I have tried to implement the percentage CDEF listed here and I can't seem to get it to work. I have attached a screenshot of my cdef. It does not show up in my threshold template. I read the CDEF tutorial, but still . Do I need item #1 to be Def statement before doing the CDEF?

Any help is appreciated.
Attachments
Screen capture of my cdef
Screen capture of my cdef
ScreenHunter_02 Apr. 09 10.44.jpg (39.83 KiB) Viewed 9133 times
Loren Erwin
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I think you might need to define the CDEF the "long way" - my reading of the code in thold that looks for valid cdefs looks for the CURRENT_DATA_SOURCE as a specific item in the CDEF not as part of a string.
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!)
namiradaki
Posts: 10
Joined: Thu Jan 04, 2007 7:21 pm

cdef problem

Post by namiradaki »

Ok Good news Howie,

After creating the cdef one item at a time as per the attached screen shot im now able to sellect the cdef under the Thold template.

AWESOME

but...

When viewing my tholds, the current data value is displayed as "0" which is incorrect. It should be showing a percentage value.

Can anyone shed some light on the matter please.

Regards,
Nick
Attachments
cdef.jpg
cdef.jpg (111.25 KiB) Viewed 9106 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: cdef problem

Post by Howie »

namiradaki wrote:Ok Good news Howie,

After creating the cdef one item at a time as per the attached screen shot im now able to sellect the cdef under the Thold template.

AWESOME

but...

When viewing my tholds, the current data value is displayed as "0" which is incorrect. It should be showing a percentage value.

Can anyone shed some light on the matter please.

Regards,
Nick
You missed out the second CURRENT_DATA_SOURCE after ALL_DATA_SOURCE_NODUPS, so your CDEF is underflowing the stack (the divide on the end has only one value to work with).
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!)
gab
Posts: 12
Joined: Tue Apr 22, 2008 9:55 am

Post by gab »

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
I am in the same situation. The CDEF works perfectly for hdd but the Host MIB hard drive return "Physical Memory" and "Virtual Memory". Unfortunatly, the CDEF return -100 for the memory.

Does anyone have an idea to help me ?

I don't understand why it works for hdd and why it doesn't work for memory.

In case of memory, the DS hdd_total seems to return the value "0".
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

gab wrote: In case of memory, the DS hdd_total seems to return the value "0".
Then why do you expect the CDEF to work correctly? :-)

You need the special data source CURRENT_PSYCHIC_VALUE
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!)
gab
Posts: 12
Joined: Tue Apr 22, 2008 9:55 am

Post by gab »

Howie wrote:Then why do you expect the CDEF to work correctly?
It works correctly for hard drives.

Howie wrote:You need the special data source CURRENT_PSYCHIC_VALUE
:roll:

Could you help me ?
Attachments
Bug with thold - CDEF Used/Total -&amp;gt; Pourcentage<br />Value -100 for Virtual and Physical Memory
Bug with thold - CDEF Used/Total -&gt; Pourcentage
Value -100 for Virtual and Physical Memory
thold_bug.JPG (25.11 KiB) Viewed 8855 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

gab wrote:
Howie wrote:Then why do you expect the CDEF to work correctly?
It works correctly for hard drives.

Howie wrote:You need the special data source CURRENT_PSYCHIC_VALUE
:roll:

Could you help me ?
It sounds like the problem is with either the data source, or your device, not threshold or CDEFs. There are (at least) a couple of different ways to get memory - one is as a 'disk' and the other is HOST-MIB Memory - do they both show 0?
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!)
gab
Posts: 12
Joined: Tue Apr 22, 2008 9:55 am

Post by gab »

I think you're right but i don't understand why there is a difference between hdd and memory ?

I use the default template "Windows 2000/XP Host" which use the script query_host_partitions.php via OIDs .1.3.6.1.2.1.25.2.3.1.x

Hard drives and Memory are in the same place in the MIB and cacti use the same script te retrieve values (hdd_total, hdd_used).
gab
Posts: 12
Joined: Tue Apr 22, 2008 9:55 am

Post by gab »

I am sorry, it was my fault.
I reinstalled the plugin and modified the files global_arrays.php and thold_functions.php and now, everything is OK.
:roll:
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests