Greetings Cacti users,lovers, and developers:
I want to create a file that has ONLY device IP, device Name, and device status = up or down
I have discovered what may be a very useful feature in Cacti - in settings/Alerting/Thold called "Status Change Command"
I created a small script that sends and email if something happens setting the path to the email script. As shown below:
If a device goes down or up - I get an email, but :
How can I create a script to access some of the variables listed in the rollover tip, like: <THOLD_HOSTNAME>,<THOLD_DESCRIPTION>,<THOLD_DOWNUP>, etc?
eholz1
Cacti user since 1.1.18
[SOLVED]How to use the "Status Change Command" in Cacti settings
Moderators: Developers, Moderators
[SOLVED]How to use the "Status Change Command" in Cacti settings
Last edited by eholz1 on Fri Oct 14, 2022 12:20 pm, edited 1 time in total.
Re: How to use the "Status Change Command" in Cacti settings
Help please The Witness?? I have found this post:https://github.com/Cacti/plugin_thold/issues/372
Which is very very close to what I want: and this reply from TheWitness: I can get the vars in the test.out file, is there a way to use env in a script to get
certain variables? ;ole THOLD_HOSTNAME. THOLD_DATE etc
Please advise,
eholz1
Which is very very close to what I want: and this reply from TheWitness: I can get the vars in the test.out file, is there a way to use env in a script to get
certain variables? ;ole THOLD_HOSTNAME. THOLD_DATE etc
Please advise,
eholz1
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: How to use the "Status Change Command" in Cacti settings
Yes, this is primarily a shell scripting training issue. Depending on your language, you can reference the environment variables in your scripts...
bash, csh, zcsh, etc...
Variable name STUFF
Value is $STUFF
Perl
Variable name STUFF
Value is $ENV{'STUFF'}
PHP
Variable name STUFF
Value is getenv('STUFF')
It goes on and on for each of your preferred languages. Easy stuff actually. You'll figure it out.
bash, csh, zcsh, etc...
Variable name STUFF
Value is $STUFF
Perl
Variable name STUFF
Value is $ENV{'STUFF'}
PHP
Variable name STUFF
Value is getenv('STUFF')
It goes on and on for each of your preferred languages. Easy stuff actually. You'll figure it out.
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?
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?
Re: How to use the "Status Change Command" in Cacti settings
Greetings The Witness and others,
Thanks for this - got it a little simpler now.
Thanks for clarificaiton,
eholz1
Thanks for this - got it a little simpler now.
Thanks for clarificaiton,
eholz1
Who is online
Users browsing this forum: No registered users and 3 guests