Details
-
Help
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
None
Description
Hello,
I write custom sms alert script.
In alerts, I point to file location:
External program path /opt/observium/alarmy/sms.py
My question is:
how to pass environment variables correctly to this script?:
http://docs.observium.org/alerting_transports/#script
this is only test, so please don't judge this:
cat sms.py
#!/usr/bin/python
import os
f = open('output.txt', 'w')
#f.write(os.environ['OBSERVIUM_ALERT_STATE'])
f.write(os.environ['OBSERVIUM_ALERT_ID'])
#f.write(OBSERVIUM_ALERT_STATE)
??
output.txt is empty now.
Maybe variables must be used from others in special set (not only one variable).
I'm not sure this question is asked in right place, but if someone can help me, I will appreciate any advice.