Text Message mail

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
joseme
Cacti User
Posts: 90
Joined: Fri May 15, 2009 9:36 am

Text Message mail

Post by joseme »

Hi Witness:
I'm trying to make some changes to text mail in THold, (I'm using thold to check the interface status Up/down), Thold sends a message showing only the interface (like " router - status- fa0/1 [int _status] is still bellow ....."), I would like to show another field more specific, for example the interface description, to see in mail "Link to New York"

I was trying to use <THRESHOLDNAME>, so I created a template named: "Router - interface status fa0/1 - Link to New York" and applied to device ... but it only shows "router - status- fa0/1"

I dont know if this descriptor <THRESHOLDNAME> works in this way, or maybe you can help me, I want to show in the message (or maybe in subject) , the interface description (in this case using the threshold name)

By the way, Is it possible to add extra NOTES, for each threshold?, so that this NOTES can be added to mail?.. It would be a great feature :) ...

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

Re: Text Message mail

Post by noname »

joseme wrote:I was trying to use <THRESHOLDNAME>, so I created a template named: "Router - interface status fa0/1 - Link to New York" and applied to device ... but it only shows "router - status- fa0/1"
Try this modification:
- http://forums.cacti.net/viewtopic.php?p=214568#p214568
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Text Message mail

Post by TheWitness »

In the current version of Thold, the Thold template can includes replacement tags such as |query_ifDesc| or |query_ifAlias| (if you have it).

The current version of THold also has a 'Reapply Suggested Names' option at the Threshold Page. Hopefully, you should not require the 'modification' that noname suggested.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
joseme
Cacti User
Posts: 90
Joined: Fri May 15, 2009 9:36 am

Re: Text Message mail

Post by joseme »

Hi:
I applied threshold template named :|host_description| - Interface Status - |query_ifName| - |query_ifAlias| to my devices and works fine, but when I tried to use the descriptor <THRESHOLDNAME>, to include it in message, it doesn't works

<html><body><font face="Verdana" size=2>An ALERT has been issued that requires your attention.<br><br><strong>Host</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>DATA</strong>: <THRESHOLDNAME><br><strong>Message</strong>: <SUBJECT><br></font></body></html>,

It shows:
DATA: RouterA - Status -fa0/0

and I think, it should show , the <THRESHOLDNAME> descriptor:
DATA: RouterA - Interface Status -fa0/0 - Link to New York

By the way, I was looking for the option 'Reapply Suggested Names' in settings, but I couldn't find it, where is it?

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

Re: Text Message mail

Post by noname »

TheWitness wrote:The current version of THold also has a 'Reapply Suggested Names' option at the Threshold Page. Hopefully, you should not require the 'modification' that noname suggested.
Thanks TheWitness, I forgot to mention it's for older version of thold.
joseme wrote:By the way, I was looking for the option 'Reapply Suggested Names' in settings, but I couldn't find it, where is it?
Console -> Thresholds -> Choose an action: "Reapply Suggested Names"
joseme
Cacti User
Posts: 90
Joined: Fri May 15, 2009 9:36 am

Re: Text Message mail

Post by joseme »

HI:
I did "Reapply Suggested Names", but it doesn´'t work, the descriptor <THRESHOLDNAME>, doesn't show the name of threshold when a mail is sent...I dont know if I'm misunderstanding the meaning of this descriptor...

html><body><font face="Verdana" size=2>An ALERT has been issued that requires your attention.<br><br><strong>Host</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>DATA</strong>: <THRESHOLDNAME><br><strong>Message</strong>: <SUBJECT><br></font></body></html>,

It shows:
DATA: RouterA - Status -fa0/0

and I think, it should show , the <THRESHOLDNAME> descriptor (I mean the threshlod name):
DATA: RouterA - Interface Status -fa0/0 - Link to New York

Could you check in your Cacti Lab environment?...

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

Re: Text Message mail

Post by noname »

Hmm, then try this query to verify:
% mysql -uUSER -pPASS cacti -t -e 'SELECT id,name,name_cache FROM data_template_data WHERE local_data_id=XX;'
XX is ID of rra, you can see it at URL of threshold settings. (.../thold.php?rra=XX&view_rrd=...)

If 'name_cache' is not the output as you expected (even if you performed "Reapply Suggested Names"),
I recommend you to report that to http://bugs.cacti.net/.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Text Message mail

Post by TheWitness »

SVN 1930 has the proper changes to support this. These things happen when you are not the original author.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
joseme
Cacti User
Posts: 90
Joined: Fri May 15, 2009 9:36 am

Re: Text Message mail

Post by joseme »

Hi Witness:
I applied the last svn I found , the threshold template is created fine, but now I can't select the template to apply to the device (It doesn't show the option) :oops: ...

Could you check..
Thanks
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Text Message mail

Post by TheWitness »

Can't check. I don't have a copy of your database.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
joseme
Cacti User
Posts: 90
Joined: Fri May 15, 2009 9:36 am

Re: Text Message mail

Post by joseme »

Hi Witness:
I made a mistake... :oops: the last THOLD svn works perfect !!... the descriptor <THRESHOLDNAME> shows what It should .

Thold is one of my favorite plugin!!....

Thanks Witness!! :D

PD: for next release, would be nice to have the chance to add "extra notes" in mail for each template (or threshold)..., I'm using thold to alert interface status ("1" for UP and "2" for DOWN), and mail only shows "1" or "2", but for someone who don't know what "1" and "2" mean is dificult, so I want to show that in "extra notes"... 1=UP, 2=DOWN
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest