Hello Forum Members,
I would like to access the cacti environment variables.
I can do this easily in a bash script via the export command.
I have seen get and set for python, which works for the environment of a virtual machine (like HOSTNAME, etcx)
But so far I have not figured out how to get the cacti vars with python.
I run the bash script from the "Alerting/Threshold" tab.
Thanks,
eholz1
[SOLVED]Cacti Environment Variables - Python - How to Get
Moderators: Developers, Moderators
[SOLVED]Cacti Environment Variables - Python - How to Get
Last edited by eholz1 on Fri Nov 11, 2022 2:37 pm, edited 1 time in total.
Re: Cacti Environment Variables - Python - How to Get
What cacti vars?
Before history, there was a paradise, now dust.
Re: Cacti Environment Variables - Python - How to Get
I am using cacti-1.2.21 at the present time
THOLD_SNMP_HOSTNAME,
#export THOLD_HOSTNAME
#export THOLD_DATE
#export THOLD_SNMP_HOSTNAME
#export THOLD_SNMP_LOCATION
#export THOLD_DOWNUP
#export THOLD_DESCRIPTION
etc, but figured it out. Just in case someone has same question: here is what I did
create a python program to use the "get.os" environ imported the os module to my python program.
added the #!/usr/bin/local/python line to top of script, the made the program executable i.e. chmod 755 for linux.
put the program name the the "Thold/Alerting" area.
Presto Changeo - got the variables
thanks for a great product
THOLD_SNMP_HOSTNAME,
#export THOLD_HOSTNAME
#export THOLD_DATE
#export THOLD_SNMP_HOSTNAME
#export THOLD_SNMP_LOCATION
#export THOLD_DOWNUP
#export THOLD_DESCRIPTION
etc, but figured it out. Just in case someone has same question: here is what I did
create a python program to use the "get.os" environ imported the os module to my python program.
added the #!/usr/bin/local/python line to top of script, the made the program executable i.e. chmod 755 for linux.
put the program name the the "Thold/Alerting" area.
Presto Changeo - got the variables
thanks for a great product
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: [SOLVED]Cacti Environment Variables - Python - How to Get
Cool. Every little step works one from apprentice to journeyman.
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 2 guests