Running external commands from a threshold
Moderators: Developers, Moderators
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Running external commands from a threshold
Depending on how you "escape", a '\\' may have to become '\\\\'. Just a clue. I hate Windows for that one reason, and I have a story about that being said from a guy who worked with DOS before the directory even existed (like in the 70's).
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: Running external commands from a threshold
i finally got it working
i misunderstood the command section. i THOUGHT you had to point it to a script file and not put the actual command in there.
so, i put C:\Windows\System32\sc.exe \\<HOSTNAME> start spooler in there and it worked!
now, my only issue is this
service is being monitiored.. its up.. all good
it stops.. thold sees that from the polling cycle, but has to wait a minium of 5 minutes to alert me its down, and fire off that command., which it does and starts the service.
service is running
next poll, cacti sees it, pulls data.. thold does tell me for another 10 minutes, as it isnt seeing it in the new state for that minimum 5 minutes yet.
i misunderstood the command section. i THOUGHT you had to point it to a script file and not put the actual command in there.
so, i put C:\Windows\System32\sc.exe \\<HOSTNAME> start spooler in there and it worked!
now, my only issue is this
service is being monitiored.. its up.. all good
it stops.. thold sees that from the polling cycle, but has to wait a minium of 5 minutes to alert me its down, and fire off that command., which it does and starts the service.
service is running
next poll, cacti sees it, pulls data.. thold does tell me for another 10 minutes, as it isnt seeing it in the new state for that minimum 5 minutes yet.
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Running external commands from a threshold
Cool!
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: Running external commands from a threshold
it would be nice to be able to have it recheck a device it ran a command against and know that its not longer a breached threshold. as it stand now it takes 10 minutes to know if its back up
Re: Running external commands from a threshold
built a new server on win 2019.
the alerts for the tholds work, but its not firing off the command i put in the script box, which is
C:\Windows\System32\sc.exe \\<HOSTNAME> start WSusCertServer
as im monitoring the service for wsuscertserver
the alerts for the tholds work, but its not firing off the command i put in the script box, which is
C:\Windows\System32\sc.exe \\<HOSTNAME> start WSusCertServer
as im monitoring the service for wsuscertserver
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Running external commands from a threshold
You may have to run the poller as a privileged account, or provide a credential that allows you to remote to the foreign host. Lastly, that script can write standard error anywhere you like it. My suggestion is instead of running a system command directly from thold, you run a script (cmd, ps, you name it), and then from there, get threshold attributes from the environment of that script "SET | grep THOLD" in Windows. (I so miss not having *NIX'isms in the native Windows. I hope you get the idea though).
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?
Who is online
Users browsing this forum: No registered users and 0 guests