Contact Destination - Local file
![](https://secure.gravatar.com/avatar/eece35488ccb927fb242176d3a8622f0.jpg?s=120&d=mm&r=g)
Would it be possible to add a local file option to the providers for a contact?
There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters?
*Spencer Ryan* | Senior Systems Administrator | sryan@arbor.net *Arbor Networks* +1.734.794.5033 (d) | +1.734.846.2053 (m) www.arbornetworks.com
![](https://secure.gravatar.com/avatar/21caf0a08d095be7196a1648d20942be.jpg?s=120&d=mm&r=g)
Hi Spencer,
r7272 added a script execution transport, that should do the trick for you - and others who have requested similar things.
Things still need to be documented, but here's how it works:
- Add alert contact of type "external program" - Set endpoint to script::/usr/local/bin/myobserviumrox.sh
In the script (or binary if you're into compiling) you 'll have access to a set of environment variables:
OBSERVIUM_ALERT_STATE OBSERVIUM_ALERT_URL OBSERVIUM_ALERT_ID OBSERVIUM_ALERT_MESSAGE OBSERVIUM_CONDITIONS OBSERVIUM_METRICS OBSERVIUM_DURATION OBSERVIUM_ENTITY_LINK OBSERVIUM_ENTITY_NAME OBSERVIUM_ENTITY_TYPE OBSERVIUM_ENTITY_DESCRIPTION OBSERVIUM_ENTITY_GRAPHS OBSERVIUM_DEVICE_HOSTNAME OBSERVIUM_DEVICE_LINK OBSERVIUM_DEVICE_HARDWARE OBSERVIUM_DEVICE_OS OBSERVIUM_DEVICE_LOCATION OBSERVIUM_DEVICE_UPTIME
Exit code of the script determines if Observium considers the alert to be successful or not: 0 is OK, anything else isn't.
Tom
On 2015-12-14 17:02, Spencer Ryan wrote:
Would it be possible to add a local file option to the providers for a contact?
There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters?
Spencer Ryan* | Senior Systems Administrator | sryan@arbor.net mailto:sryan@arbor.net *Arbor Networks* +1.734.794.5033 (d) | +1.734.846.2053 (m) www.arbornetworks.com http://www.arbornetworks.com/
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/eece35488ccb927fb242176d3a8622f0.jpg?s=120&d=mm&r=g)
Awesome! I've actually got a patch to the IRC bot to upstream, and this can remove some code I've modified in the alerter.
I've got the IRC bot to send alerts to a specific channel, currently doing it via named pipes between alerter and the IRC bot.
*Spencer Ryan* | Senior Systems Administrator | sryan@arbor.net *Arbor Networks* +1.734.794.5033 (d) | +1.734.846.2053 (m) www.arbornetworks.com
On Wed, Dec 16, 2015 at 10:28 AM, Tom Laermans tom.laermans@powersource.cx wrote:
Hi Spencer,
r7272 added a script execution transport, that should do the trick for you
- and others who have requested similar things.
Things still need to be documented, but here's how it works:
- Add alert contact of type "external program"
- Set endpoint to script::/usr/local/bin/myobserviumrox.sh
In the script (or binary if you're into compiling) you 'll have access to a set of environment variables:
OBSERVIUM_ALERT_STATE OBSERVIUM_ALERT_URL OBSERVIUM_ALERT_ID OBSERVIUM_ALERT_MESSAGE OBSERVIUM_CONDITIONS OBSERVIUM_METRICS OBSERVIUM_DURATION OBSERVIUM_ENTITY_LINK OBSERVIUM_ENTITY_NAME OBSERVIUM_ENTITY_TYPE OBSERVIUM_ENTITY_DESCRIPTION OBSERVIUM_ENTITY_GRAPHS OBSERVIUM_DEVICE_HOSTNAME OBSERVIUM_DEVICE_LINK OBSERVIUM_DEVICE_HARDWARE OBSERVIUM_DEVICE_OS OBSERVIUM_DEVICE_LOCATION OBSERVIUM_DEVICE_UPTIME
Exit code of the script determines if Observium considers the alert to be successful or not: 0 is OK, anything else isn't.
Tom
On 2015-12-14 17:02, Spencer Ryan wrote:
Would it be possible to add a local file option to the providers for a contact?
There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters?
- Spencer Ryan* | Senior Systems Administrator | sryan@arbor.net
*Arbor Networks* +1.734.794.5033 (d) | +1.734.846.2053 (m) http://www.arbornetworks.com/www.arbornetworks.com
observium mailing listobservium@observium.orghttp://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/21caf0a08d095be7196a1648d20942be.jpg?s=120&d=mm&r=g)
I've got 2 IRC bot specific transports in the pipeline as well ;-)
One for a TCP connection to eggdrop, one for the all known gozerbot-and-clones udp.py.
Tom
On 2015-12-16 16:31, Spencer Ryan wrote:
Awesome! I've actually got a patch to the IRC bot to upstream, and this can remove some code I've modified in the alerter.
I've got the IRC bot to send alerts to a specific channel, currently doing it via named pipes between alerter and the IRC bot.
Spencer Ryan* | Senior Systems Administrator | sryan@arbor.net mailto:sryan@arbor.net *Arbor Networks* +1.734.794.5033 (d) | +1.734.846.2053 (m) www.arbornetworks.com http://www.arbornetworks.com/
On Wed, Dec 16, 2015 at 10:28 AM, Tom Laermans <tom.laermans@powersource.cx mailto:tom.laermans@powersource.cx> wrote:
Hi Spencer, r7272 added a script execution transport, that should do the trick for you - and others who have requested similar things. Things still need to be documented, but here's how it works: - Add alert contact of type "external program" - Set endpoint to script::/usr/local/bin/myobserviumrox.sh In the script (or binary if you're into compiling) you 'll have access to a set of environment variables: OBSERVIUM_ALERT_STATE OBSERVIUM_ALERT_URL OBSERVIUM_ALERT_ID OBSERVIUM_ALERT_MESSAGE OBSERVIUM_CONDITIONS OBSERVIUM_METRICS OBSERVIUM_DURATION OBSERVIUM_ENTITY_LINK OBSERVIUM_ENTITY_NAME OBSERVIUM_ENTITY_TYPE OBSERVIUM_ENTITY_DESCRIPTION OBSERVIUM_ENTITY_GRAPHS OBSERVIUM_DEVICE_HOSTNAME OBSERVIUM_DEVICE_LINK OBSERVIUM_DEVICE_HARDWARE OBSERVIUM_DEVICE_OS OBSERVIUM_DEVICE_LOCATION OBSERVIUM_DEVICE_UPTIME Exit code of the script determines if Observium considers the alert to be successful or not: 0 is OK, anything else isn't. Tom On 2015-12-14 17:02, Spencer Ryan wrote:
Would it be possible to add a local file option to the providers for a contact? There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters? * Spencer Ryan* | Senior Systems Administrator | sryan@arbor.net <mailto:sryan@arbor.net> *Arbor Networks* +1.734.794.5033 <tel:%2B1.734.794.5033> (d) | +1.734.846.2053 <tel:%2B1.734.846.2053> (m) www.arbornetworks.com <http://www.arbornetworks.com> _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
_______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/dee82a22b9a73f459fe180128811e4c1.jpg?s=120&d=mm&r=g)
Hi Tom,
r7272 added a script execution transport, that should do the trick for you - and others who have requested similar things.
Things still need to be documented, but here's how it works:
- Add alert contact of type "external program"
- Set endpoint to script::/usr/local/bin/myobserviumrox.sh
In the script (or binary if you're into compiling) you 'll have access to a set of environment variables:
Awesome! Sander
![](https://secure.gravatar.com/avatar/3e0204163e0dea3d9401901792ec89a6.jpg?s=120&d=mm&r=g)
wonderful news!
now i can write a script file to send text alerts to our staff :)
Simon
On 16 Dec 2015, at 3:28 pm, Tom Laermans tom.laermans@powersource.cx wrote:
Hi Spencer,
r7272 added a script execution transport, that should do the trick for you - and others who have requested similar things.
Things still need to be documented, but here's how it works:
- Add alert contact of type "external program"
- Set endpoint to script::/usr/local/bin/myobserviumrox.sh
In the script (or binary if you're into compiling) you 'll have access to a set of environment variables:
OBSERVIUM_ALERT_STATE OBSERVIUM_ALERT_URL OBSERVIUM_ALERT_ID OBSERVIUM_ALERT_MESSAGE OBSERVIUM_CONDITIONS OBSERVIUM_METRICS OBSERVIUM_DURATION OBSERVIUM_ENTITY_LINK OBSERVIUM_ENTITY_NAME OBSERVIUM_ENTITY_TYPE OBSERVIUM_ENTITY_DESCRIPTION OBSERVIUM_ENTITY_GRAPHS OBSERVIUM_DEVICE_HOSTNAME OBSERVIUM_DEVICE_LINK OBSERVIUM_DEVICE_HARDWARE OBSERVIUM_DEVICE_OS OBSERVIUM_DEVICE_LOCATION OBSERVIUM_DEVICE_UPTIME
Exit code of the script determines if Observium considers the alert to be successful or not: 0 is OK, anything else isn't.
Tom
On 2015-12-14 17:02, Spencer Ryan wrote:
Would it be possible to add a local file option to the providers for a contact?
There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters?
Spencer Ryan | Senior Systems Administrator | sryan@arbor.net mailto:sryan@arbor.net Arbor Networks +1.734.794.5033 (d) | +1.734.846.2053 (m) http://www.arbornetworks.com/www.arbornetworks.com http://www.arbornetworks.com/
observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/3e0204163e0dea3d9401901792ec89a6.jpg?s=120&d=mm&r=g)
is it possible to fix the Add Contacts Panel?
currently the drop down box doesn’t fit on my screen properly?
i have to scroll inside a tiny window panel
ive tried firefox, chrome, safari and IE, before people ask try another browser...
screenshot showing silly CSS bug :)
Simon
On 16 Dec 2015, at 3:28 pm, Tom Laermans tom.laermans@powersource.cx wrote:
Hi Spencer,
r7272 added a script execution transport, that should do the trick for you - and others who have requested similar things.
Things still need to be documented, but here's how it works:
- Add alert contact of type "external program"
- Set endpoint to script::/usr/local/bin/myobserviumrox.sh
In the script (or binary if you're into compiling) you 'll have access to a set of environment variables:
OBSERVIUM_ALERT_STATE OBSERVIUM_ALERT_URL OBSERVIUM_ALERT_ID OBSERVIUM_ALERT_MESSAGE OBSERVIUM_CONDITIONS OBSERVIUM_METRICS OBSERVIUM_DURATION OBSERVIUM_ENTITY_LINK OBSERVIUM_ENTITY_NAME OBSERVIUM_ENTITY_TYPE OBSERVIUM_ENTITY_DESCRIPTION OBSERVIUM_ENTITY_GRAPHS OBSERVIUM_DEVICE_HOSTNAME OBSERVIUM_DEVICE_LINK OBSERVIUM_DEVICE_HARDWARE OBSERVIUM_DEVICE_OS OBSERVIUM_DEVICE_LOCATION OBSERVIUM_DEVICE_UPTIME
Exit code of the script determines if Observium considers the alert to be successful or not: 0 is OK, anything else isn't.
Tom
On 2015-12-14 17:02, Spencer Ryan wrote:
Would it be possible to add a local file option to the providers for a contact?
There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters?
Spencer Ryan | Senior Systems Administrator | sryan@arbor.net mailto:sryan@arbor.net Arbor Networks +1.734.794.5033 (d) | +1.734.846.2053 (m) http://www.arbornetworks.com/www.arbornetworks.com http://www.arbornetworks.com/
observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/0fa97865a0e1ab36152b6b2299eedb49.jpg?s=120&d=mm&r=g)
This is an interaction between the library which builds the dropdown menus and the way the modals are built. It's kinda amusing, but I'm not sure what the fix would be.
adam. On 16/12/2015 16:09:42, Simon Smith simonsmith5521@gmail.com wrote: is it possible to fix the Add Contacts Panel?
currently the drop down box doesn’t fit on my screen properly?
i have to scroll inside a tiny window panel
ive tried firefox, chrome, safari and IE, before people ask try another browser...
screenshot showing silly CSS bug :)
Simon
On 16 Dec 2015, at 3:28 pm, Tom Laermans <tom.laermans@powersource.cx [mailto:tom.laermans@powersource.cx]> wrote:
Hi Spencer,
r7272 added a script execution transport, that should do the trick for you - and others who have requested similar things.
Things still need to be documented, but here's how it works:
- Add alert contact of type "external program" - Set endpoint to script::/usr/local/bin/myobserviumrox.sh
In the script (or binary if you're into compiling) you 'll have access to a set of environment variables:
OBSERVIUM_ALERT_STATE OBSERVIUM_ALERT_URL OBSERVIUM_ALERT_ID OBSERVIUM_ALERT_MESSAGE OBSERVIUM_CONDITIONS OBSERVIUM_METRICS OBSERVIUM_DURATION OBSERVIUM_ENTITY_LINK OBSERVIUM_ENTITY_NAME OBSERVIUM_ENTITY_TYPE OBSERVIUM_ENTITY_DESCRIPTION OBSERVIUM_ENTITY_GRAPHS OBSERVIUM_DEVICE_HOSTNAME OBSERVIUM_DEVICE_LINK OBSERVIUM_DEVICE_HARDWARE OBSERVIUM_DEVICE_OS OBSERVIUM_DEVICE_LOCATION OBSERVIUM_DEVICE_UPTIME
Exit code of the script determines if Observium considers the alert to be successful or not: 0 is OK, anything else isn't.
Tom
On 2015-12-14 17:02, Spencer Ryan wrote:
Would it be possible to add a local file option to the providers for a contact?
There are situations where we would like to manipulate the data with a script of our own based on triggered alerts and recoveries and instead of mucking around the DB by hand having Observium write out the alerts to a file would be the easiest. Maybe just have it take a path and just >> the alert contents to whatever the user enters?
Spencer Ryan | Senior Systems Administrator | sryan@arbor.net [mailto:sryan@arbor.net] Arbor Networks +1.734.794.5033 (d) | +1.734.846.2053 (m) [http://www.arbornetworks.com/%5Dwww.arbornetworks.com [http://www.arbornetworks.com/]
_______________________________________________ observium mailing list observium@observium.org [mailto:observium@observium.org] http://postman.memetic.org/cgi-bin/mailman/listinfo/observium [http://postman.memetic.org/cgi-bin/mailman/listinfo/observium]
_______________________________________________ observium mailing list observium@observium.org [mailto:observium@observium.org] http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (5)
-
Adam Armstrong
-
Sander Steffann
-
Simon Smith
-
Spencer Ryan
-
Tom Laermans