:roll: Thresholds alarming prematurely?

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

:roll: Thresholds alarming prematurely?

Post by Cactus84 »

:roll:

Hi Guys I have just got thresholds, as close as possible to working for Percentage for Disk Space. I wanted to be emailed when the disk space was at 90% on the root partition.

So I followed this example: http://vivaz.net/2009/06/cacti-install- ... -settings/

Setup my Threshold for /


I created a massive file using seq to run up the disk space to get to 90%. And then Bam at 65% disk space I get an email letting me know I have gone above the threshold.

/dev/mapper/vg_templatenox-lv_root
34G 21G 12G 65% /

Now in the screenshot I see under the 'current' tab it's at 178.5804 which , yes is above 90 or 90%, hence the alarm, however the disk space has 65% free shouldn't this be displaying 65.88833 or something?

I am using Cacti 0.8.7.i and tholds: 0.4.9-3

Could someone please assist?? :o
Attachments
tholdpercen.PNG
tholdpercen.PNG (4.75 KiB) Viewed 4168 times
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

I have the right CDEF Formula right...?? :evil:
Attachments
cdefformula.PNG
cdefformula.PNG (25.89 KiB) Viewed 4163 times
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: :roll: Thresholds alarming prematurely?

Post by noname »

I was not aware such a "hidden" Special Data Source (VALUE_OF_HDD_TOTAL)...
Currently Cacti doesn't support that, but related code is included even in the latest (v0.4.9) thold plugin.

But current thold plugin can use another data source item within the given datasource to calculate evaluation value.
Try to use "RPN Expression" instead CDEF.
Does the same issue occur?

Graph:
Image

Threshold settings:
Image

Result:
Image
(53MB / 1.5GB = about 3.5%)
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Hi noname, Thanks for your reply!

There is no hidden function I added into Cacti Manually using the instructions using this link: http://vivaz.net/2009/06/cacti-install- ... -settings/

17.4 some threshold examples

Create disk usage Thold template
When (used_space/total_space%) > 90%, cacti will send alert mail
4.1.1 Add “VALUE_OF_HDD_TOTAL” at global _arrays.php

vi /opt/www/html/cacti/include/global _arrays.php
add VALUE_OF_HDD_TOTAL

find

$custom_data_source_types = array(

add

“VALUE_OF_HDD_TOTAL” => “Value of hdd_total data source”,

add a new CDEF
Now go to Console -> Graph Management -> CDEFs click “Add” to add a new CDEF
Add new CDEF named like “Used Disk Space Percent”, at this CDEF, add 5 items:

Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Custom String: 100
Item #3 Operator: *
Item #4 Special Data Source: VALUE_OF_HDD_TOTAL
Item #5 Operator: /


I have used your instructions below and changed from CDEF TO RPI

|ds:hdd_used|,100,*,|ds:hdd_total|,/

and it's looking better , I will test it tommrow a bit more. Still I wish I had a better understanding of the calculated value...

I know this is a bigger calculation then the last example...


Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_templatenox-lv_root
34G 31G 734M 98% /
Threshold email:

Partition - /dev/mapper/vg_ [hdd_used] [hdd_used] went above threshold of 90 with 3896.2081




Thanks
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: :roll: Thresholds alarming prematurely?

Post by noname »

Cactus84 wrote:There is no hidden function I added into Cacti Manually using the instructions using this link: http://vivaz.net/2009/06/cacti-install- ... -settings/
Hmm, it seems that modification was derived from this post.
- http://forums.cacti.net/viewtopic.php?f=17&t=20486 (Of course, that's not ugly)
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Hi noname,
We still seem to have an issue I am posting my screenshots below:

This time the disk go to 70% and sent an alarm email:

Disk Stats:

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_templatenox-lv_root
34G 22G 9.5G 70% /

Email:

ALERT: - Partition - /dev/mapper/vg_ [hdd_used] [hdd_used] went above threshold of 90 with 126.6311

and I used the RPN Expression...

In the above screenshot it shows current: 224.0932 which makes sense as 22GB is in use... how the alarm it hit's me up at 70% the alarm comes through and the graph is showing: 126.6311?
Attachments
tholdissue1.PNG
tholdissue1.PNG (73.17 KiB) Viewed 4140 times
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Here is the thold screenshot alarm...
Attachments
tholdissue2.PNG
tholdissue2.PNG (7.83 KiB) Viewed 4140 times
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

I am using RRDtool 1.4, anyone else having issues..?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: :roll: Thresholds alarming prematurely?

Post by noname »

"ucd/net - Hard Drive Space" data template doesn't have "hdd_total" data source item.
Try this RPN expression instead:

Code: Select all

|ds:hdd_used|,100,*,|ds:hdd_used|,|ds:hdd_free|,+,/
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Hi noname,
Thanks for your reply, this is the most accurate yet! I am noticing with theshold you have to wait a bit, so it can cycle through to get the result I will keep you posted soon!

Thanks!
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Thanks noname it works great now on the ucd / net graphs just one last request I have tried your other formula:

|ds:hdd_used|,100,*,|ds:hdd_total|,/

On the HOST-MIB graphs and it seems to be showing 73.5498


/dev/mapper/VolGroup00-LogVol00
18G 13G 3.7G 78% /

Instead of close to the 78% in use. Can you please double check this?

Thanks
Attachments
79.PNG
79.PNG (73.71 KiB) Viewed 4128 times
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: :roll: Thresholds alarming prematurely?

Post by noname »

Cactus84 wrote: On the HOST-MIB graphs and it seems to be showing 73.5498

/dev/mapper/VolGroup00-LogVol00
18G 13G 3.7G 78% /

Instead of close to the 78% in use. Can you please double check this?
Probably it's a difference between AVERAGE (=graph item) and LAST (=thold current value).
- http://forums.cacti.net/viewtopic.php?p=225422#p225422
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Thanks for your reply noname,

Where can I look to view this and change it? If not I will have to settle, and just change the threshold value to an "as close" value.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: :roll: Thresholds alarming prematurely?

Post by noname »

Thold plugin uses the result which is last stored into poller_output table.

In detail,
at function process_poller_output() in 'cacti/lib/poller.php', Cacti calls this API function:

Code: Select all

api_plugin_hook_function('poller_output', $rrd_update_array);
That API function will hand the result to registered function of plugins, so plugins can use the value which is most recently polled for their own purposes.
e.g.) thold_poller_output() in 'plugins/thold/includes/polling.php'


On the other hand, normally in the graph template, graph items are defined to show its AVERAGE which is stored in RRD file.
Probably that value is already adjusted to fit polling interval, and consolidated (e.g. averaged) by certain periods depend on RRA settings.

You can change graph template items with LAST instead of AVERAGE, but I'm not sure whether you will see close values to the threshold's.
Cactus84
Cacti User
Posts: 55
Joined: Thu Jan 12, 2012 8:22 pm

Re: :roll: Thresholds alarming prematurely?

Post by Cactus84 »

Thanks for your reply, noname

Before I attempt to play with these settings I was looking in the Thresholds section and notices it has the exact value as a meter.

Can this used for actual disk space or is it referring the exact value of RRD on the graph?
Attachments
evalue.PNG
evalue.PNG (4.48 KiB) Viewed 4084 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest