Cactiusers.org


It is currently Thu May 17, 2012 8:46 am




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
 [Thold]: nan bugs - DS fetching error 
Author Message
User

Joined: Wed Jan 04, 2006 2:17 am
Posts: 28
Post [Thold]: nan bugs - DS fetching error
I have huge problems with thold and "nan" values in RRDtool databases.

1) If any DS of a Cacti Data Source is "nan", the thold plugin can't fetch any value of the RRDtool database, even if some RRDtool DS are not "nan". In this situation, when I create a threshold, thold does not display the value of any DS.

Example: Data Source with two DS
DS1 is currently 100
DS2 is currently nan.

Thold does not display the data for DS1 nor DS2. So, if I have set a (low) threshold on DS1, thold will trigger a wrong alarm if DS2 is nan and DS1 is okay.

I have looked in the cacti log. The rrdtool fetch command is okay. And if all DS are not nan, thold works as expected.

2) If a low threshold is set and the current DS is nan, thold does initiate a threshold alarm. This is a minor "bug", which was already reported in "Feature requests". I think, this behavior is related to bug No. 1, since it seems that thold can't handle "nan" at all.

System Info:
Cacti 0.8.6h
Thold 0.2.7
(problems occur also with 0.8.6g and 0.2.6)

I would appreciate any help on solving this issue.


Fri Jan 06, 2006 6:44 am
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post 
I have actually been debugging this problem for awhile already, the issue is that the rrdtool_execute doesn't seem to be properly returning the value if there is a nan. I kinda lost track of where I was on this bug for a while as the datasource that I was having the issue with fixed itself after a re-install on my test machine. I will see if I can cause another datasource to break so that I can start testing fixes for this again.

Thanks!


Fri Jan 06, 2006 10:32 am
User

Joined: Wed Jan 04, 2006 2:17 am
Posts: 28
Post 
Great. If you need any help for testing, please let me know.

This bug is very important for me, because almost all my RRDtool databases are having DS with nan values occuring quite often. In addition, I have also some spare DS that I don't update with values all the time. So, thold does currently not work for these databases.
I have also read some posts on cacti.net about people having observed that thold sometimes does not view the current value on the thold page. I guess that these problems are caused by this "nan bug" also.

Thanks again


Sat Jan 07, 2006 11:12 am
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post 
ralfk wrote:
Great. If you need any help for testing, please let me know.

This bug is very important for me, because almost all my RRDtool databases are having DS with nan values occuring quite often. In addition, I have also some spare DS that I don't update with values all the time. So, thold does currently not work for these databases.
I have also read some posts on cacti.net about people having observed that thold sometimes does not view the current value on the thold page. I guess that these problems are caused by this "nan bug" also.

Thanks again


Yep, they are one and the same. I see what I can do about it.


Sat Jan 07, 2006 2:15 pm
New User

Joined: Tue Dec 19, 2006 2:37 pm
Posts: 15
Post 
Any update on this? I'm seeing the same issue.
Thold 0.3.0
cacti Version 0.8.6i

I'm running Windows.

Let me know if I can help troubleshoot.


Thu Jan 11, 2007 7:25 pm
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post 
Its not an issue anymore in the current version.


Thu Jan 11, 2007 8:24 pm
New User

Joined: Tue Dec 19, 2006 2:37 pm
Posts: 15
Post 
The latest version is 0.3.0 correct? I'm still seeing this problem. Maybe I'm doing something wrong? What info can I give to troubleshoot?


Thu Jan 11, 2007 10:12 pm
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post 
Sorry, I meant the latest SVN doesn't have this issue anymore. I promise to get it out eventually, just still adding a few items. For instance, a few minutes ago I added the ability to Create Thresholds for multiple hosts at once by using the drop down box on the Devices page.


Thu Jan 11, 2007 11:38 pm
New User

Joined: Tue Dec 19, 2006 2:37 pm
Posts: 15
Post 
Awesome. Sounds like some great features are coming. I look forward to it.

I really appreciate the work that you put into this.

Let me know if there is anything I can do to help


Fri Jan 12, 2007 2:43 pm
New User

Joined: Tue May 15, 2007 3:19 pm
Posts: 3
Post 
I have the same issue.

Any solutions?

Regards


Thu Oct 02, 2008 2:29 pm
User

Joined: Wed Jan 04, 2006 2:17 am
Posts: 28
Post 
I have compiled a short document about all changes I have made towards thold 0.3.0. See PDF doc attached.

For this specific bug I have changed the function rrdtool_function_fetch() in rrd.php.

Fix regex matching of nan values on all DS positions
Old (line 401-403):
Code:
}else{
$regexps[$i] .= '[\-]?[0-9]{1}\.[0-9]+e[\+-][0-9]{2,3}';
}

New: Just accept all non-whitespace characters between spaces (incl. nan)
Code:
}else{
$regexps[$i] .= '\S+';
}


In addition you have to change the function call in thold-functions.php:
Code:
$result = rrdtool_function_fetch($rra, trim($last_time_entry), trim($last_needed),0,1);
in order to show unknown values.

See attached doc for more info about other NaN bugs I have fixed. For me thold 0.3.0 works now reliable, especially since I can't use newer releases, because I don't update my RRD files with the poller.


Attachments:
thold_0.3.0_fixes.pdf.gz [240.13 KiB]
Downloaded 129 times
Mon Oct 06, 2008 1:44 am
New User

Joined: Tue May 15, 2007 3:19 pm
Posts: 3
Post 
Hi ralfk

The file that you posted worked fine, just for hdd_total, but hdd_used and hdd_percent still not working, the value is "U".

Do you have any idea what's happening?

Regards


Mon Oct 06, 2008 10:26 am
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post 
ralfk wrote:
since I can't use newer releases, because I don't update my RRD files with the poller.


My next release will have an option to switch back to the old way (hopefully). From a technical standpoint, it should be an easy swap, but we will see how it goes.


Mon Oct 06, 2008 9:43 pm
User

Joined: Wed Jan 04, 2006 2:17 am
Posts: 28
Post 
jimmy wrote:
My next release will have an option to switch back to the old way (hopefully).

That would be really great !


Tue Oct 07, 2008 1:15 am
User

Joined: Wed Jan 04, 2006 2:17 am
Posts: 28
Post 
luizmultirede wrote:
but hdd_used and hdd_percent still not working, the value is "U".

Sorry, no idea. You would need to provide much more details about your problem (sample rrd file with values, what values and thold behavior do you expect ?)


Tue Oct 07, 2008 1:19 am
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: