Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun Oct 21, 2018 2:26 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Trigger for specific values
PostPosted: Tue Jan 23, 2018 7:21 pm 
Offline
User avatar

Joined: Wed Jun 12, 2013 6:25 pm
Posts: 20
I think the only way to do this is with Data Manipulation, but I'm unsure.

I have exact values being returned from a RAID staus. 1, and 3 are valid "OK" values. However explicitly a 2 or anything higher than a 3 indicates a failure. Trying to figure out how to make a Threshold rule for this, or if it can even handle it has been boggling me.

Has anyone run into this before?


Top
 Profile  
 
 Post subject: Re: Trigger for specific values
PostPosted: Wed Jan 24, 2018 7:04 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1519
You'd need to use RPN Expression's to return a manipulated value. I haven't used them before, but it would be something like:
Code:
|ds:ping|,1,EQ,0,|ds:ping|,3,EQ,1,|ds:ping|,IF,IF


Checkout : https://oss.oetiker.ch/rrdtool/tut/rpntutorial.en.html

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Trigger for specific values
PostPosted: Wed Jan 24, 2018 10:43 am 
Offline
User avatar

Joined: Wed Jun 12, 2013 6:25 pm
Posts: 20
netniV wrote:
You'd need to use RPN Expression's to return a manipulated value. I haven't used them before, but it would be something like:
Code:
|ds:ping|,1,EQ,0,|ds:ping|,3,EQ,1,|ds:ping|,IF,IF


Checkout : https://oss.oetiker.ch/rrdtool/tut/rpntutorial.en.html


Good ole RPN. Thanks again netniV.


Top
 Profile  
 
 Post subject: Re: Trigger for specific values
PostPosted: Thu Jan 25, 2018 4:34 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1519
If you get the expression working, post it here as I am curious how close I am lol. By my reckoning it should produce 0 (for 1), 1 (for 3), current value for 2 or 4+

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Trigger for specific values
PostPosted: Thu Jan 25, 2018 2:18 pm 
Offline
User avatar

Joined: Wed Jun 12, 2013 6:25 pm
Posts: 20
netniV wrote:
If you get the expression working, post it here as I am curious how close I am lol. By my reckoning it should produce 0 (for 1), 1 (for 3), current value for 2 or 4+


I've got a non-production cage I can pull a drive out of to test and verify this works. However, I decided to simply test for 1, 3 and greater than 3 as it seemed to be the easiest method.
Code:
|ds:hdd_status|,1,EQ,0,|ds:hdd_status|,2,EQ,1,|ds:hdd_status|,3,EQ,0,|ds:hdd_status|,3,GT,1,|ds:hdd_status|,IF,IF,IF,IF


Effectively putting the the logic I initially stated into play:
- 1 = Good
- 2 = Bad
- 3 = Good
- > 3 = Bad
There are no return codes less than 1 and anything that is not a 1 or 3 indiciates a failure that needs eyes on inspection.

Currently a 3 is returning a 0. So that part I know to be working. However before I see a failure somewhere, I'd like to test one.

The other detail (for anyone else who stumbles upon this later) that few mention, is that data manipulation alters the data from the data source then hands it back to the "Threshold Engine" if you will, so that it only sees (for this query) a 1 or a 0. I'm only triggering the "Alert - High", on a 1. Nothing else. If you're reading top to bottom, down the threshold page, it reads counterintuitively like data manipulation comes afterwards.

Thanks again. RPN + Logic Flow is not the most intuituve without official Thold documentation anywhere, but it certainly does get results.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 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:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group