On 12/05/2016 15:47:31, Andy Lemin <andy@brandwatch.com> wrote:
Fantastic, thank you.Yea I did think that because it was an 'id' which sounded like it a primary key and not just a String, but wasn't sure.Anyway I have the ID now, ran test_alert.php again and the output is below with the 500 error (After all the email stuff etc);I can see it is a 500 Server Error, however the Curl command works fine.As I see the channel not found error, this is making me thing that the Slacdk contact is the wrong type maybe?Should the contact "Method" be "Custom Webhook" and not "Slack"?This works;#curl -X POST -H 'Content-type: application/json' --data '{"text":"This is a test"}' https://hooks.slack.com/services/CODES/CODES/CODESBut this one doesn't;
# curl -X POST -H 'Content-type: application/json' --data '{"channel":"#networks-private","username":"Network-Alerts","url":"https:\/\/hooks.slack.com\/services\/CODES\/CODES\/CODES"}' https://hooks.slack.com/services/CODES/CODES/CODES
channel_not_found
o Notifying [slack] Observium Slack:
{"channel":"#networks-private","username":"Network-Alerts","url":"https:\/\/hooks.slack.com\/services\/CODES\/CODES\/CODES"}
REQUEST[https://hooks.slack.com/services/CODES/CODES/CODES]
REQUEST STATUS[500 Server Error]
Thanks again, Getting closer now.. ;)
Andy.
_______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observiumOn Thu, May 12, 2016 at 2:46 PM, Adam Armstrong <adama@memetic.org> wrote:The IDs are usually most easily found in the URL bar. Once you click the cog you'll end up in the "alerts" tab of the "device" page, with alert_entry=<id> in the URL bar, this is the id you need.Some of the terminology in the alerting system is confusing, owing to the pace with which it was implemented :Dadam.On 12/05/2016 14:44:20, Andy Lemin <andy@brandwatch.com> wrote:
I'm really sorry, I don't mean to annoy when you are helping.But I have no idea where that is because the terminology doesn't match up with what I see on the web page, and I'm a newbie.I'm clicking on Alerts from the main menu (Globe icon), Alert Types is "All", And I'm changing the filter to "All".I then see all the devices. Do you mean the cog next to each of the devices?I clicked on the cog (far right) for a single device that has my Device_Down_Checker in the Alert column, that takes me to another Alert details page (but this time for a specific device), and I see another cog higher up in the right hand corner. If I choose Device Data on that cog, I do not see an "id" for the alert in the array, only "device_id".For the life of me, I cannot find alert_id?I am trying, I'm not just throwing questions without trying ;)_______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observiumOn Thu, May 12, 2016 at 2:25 PM, Adam Armstrong <adama@memetic.org> wrote:It's the id from alert_entry on the per-alert page, which you get to by clicking on the cog icon on the alert table.adam.On 12/05/2016 14:24:31, Adam Armstrong <adama@memetic.org> wrote:
-a is an alert_checker_id, not some random bit of text.adam.On 12/05/2016 14:22:59, Andy Lemin <andy@brandwatch.com> wrote:
Hi, I've just tried that script again (thanks for the reminder) and the exact same problem shows, the debug output is below.It seems to find the email alert ok, but not the slack alert.Both the Email "Contact" and the Slack "Contact" have the same Alert Checker "Device_Down_Checker" associated with them.It looks to me like their could be a problem with the DB queries as the error "Incorrect table name" is thrown just before the notifiers lookup due to the NULL values.Or should I try looking in the tables "alert_contacts", "alert_contacts_assoc"? What is the mysql default user/password? (haven't changed it at any point).To me it looks like the issue could be because the alert_checker_id is NULL for some reason, but just it still finds the email alert which is strange and leads me to question the debug.Thanks for your help Adam,Andy.root@observium:/opt/observium# php ./test_alert.php -a Device_Down_Checker -d
DEBUG!
SQL[SELECT `attrib_value` FROM `observium_attribs` WHERE `attrib_type` = 'dbSchema';]
SQL RUNTIME[0.00005889s]
SQL[SELECT @@SESSION.sql_mode;]
SQL RUNTIME[0.00007200s]
SQL[SELECT `attrib_value` FROM `observium_attribs` WHERE `attrib_type` = 'current_rev';]
SQL RUNTIME[0.00003600s]
SQL[SELECT * FROM `config`]
SQL RUNTIME[0.00005698s]
CMD[/bin/hostname -f]
CMD EXITCODE[0]
CMD RUNTIME[0.0016s]
STDOUT[
observium.<privatedomain>.net
]
Observium 0.16.5.7833
Test Alert Notification
CMD[/opt/observium/scripts/distro]
CMD EXITCODE[0]
CMD RUNTIME[0.0222s]
CMD EXITDELAY[10ms]
STDOUT[
Linux|3.2.0-4-amd64|amd64|Debian|7.9
]
CMD[/usr/bin/env python --version 2>&1]
CMD EXITCODE[0]
CMD RUNTIME[0.002s]
CMD EXITDELAY[10ms]
STDOUT[
Python 2.7.3
]
SQL[SELECT version();]
SQL RUNTIME[0.00019193s]
CMD[/usr/bin/snmpget --version 2>&1]
CMD EXITCODE[0]
CMD RUNTIME[0.002s]
CMD EXITDELAY[10ms]
STDOUT[
NET-SNMP version: 5.4.3
]
CMD[/usr/bin/rrdtool --version |head -n1]
CMD EXITCODE[0]
CMD RUNTIME[0.0034s]
CMD EXITDELAY[10ms]
STDOUT[
RRDtool 1.4.7 Copyright 1997-2012 by Tobias Oetiker <tobi@oetiker.ch>
]
CMD[date "+%:z"]
CMD EXITCODE[0]
CMD RUNTIME[0.0014s]
CMD EXITDELAY[10ms]
STDOUT[
+01:00
]
SQL[SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);]
SQL RUNTIME[0.00015593s]
CMD[/usr/bin/env apache2 -v | awk '/Server version:/ {print $3}']
CMD EXITCODE[0]
CMD RUNTIME[0.0126s]
STDOUT[
Apache/2.2.22
]
SQL[SELECT @@SESSION.sql_mode;]
SQL RUNTIME[0.00013614s]
SQL[SHOW VARIABLES LIKE 'character_set_connection']
SQL RUNTIME[0.00026202s]
##### Software versions #####
o OS Linux 3.2.0-4-amd64 [amd64] (Debian 7.9)
o Apache 2.2.22
o PHP 5.4.45-0+deb7u2
o Python 2.7.3
o MySQL 5.5.47-0+deb7u1 (extension: mysqli 5.5.47)
o SNMP NET-SNMP 5.4.3
o RRDtool 1.4.7
##### MySQL mode #####
o MySQL
##### Charset info #####
o PHP UTF-8
o MySQL utf8
##### Timezones info #####
o Date Thursday, 12-May-16 13:59:29 BST
o PHP +01:00
o MySQL +01:00
SQL[SELECT * FROM `alert_tests` WHERE 1]
SQL RUNTIME[0.00005603s]
Cached 1 alert rules.
SQL[SELECT * FROM `alert_assoc`]
SQL RUNTIME[0.00004220s]
SQL[SELECT * FROM `alert_table` WHERE `alert_table_id` = 'Device_Down_Checker']
SQL RUNTIME[0.00004292s]
SQL[SELECT * FROM `devices` WHERE `device_id` = '']
SQL RUNTIME[0.00005102s]
SQL[SELECT * FROM `` WHERE ``.`` = '']
SQL RUNTIME[0.00004697s]
ERROR[Error in query: (Incorrect table name '') 1103]
SQL[SELECT * FROM `alert_contacts` WHERE `contact_disabled` = 0 AND `contact_id` IN (SELECT `contact_id` FROM `alert_contacts_assoc` WHERE `alert_checker_id` = '');]
SQL RUNTIME[0.00030088s]
o Notifying [email] : {"email":"network-admin@brandwatch.com"}
DEBUG: Recv: 220 mail.<privatedomain>.net ESMTP Exim 4.80 Thu, 12 May 2016 12:59:35 +0000
DEBUG: Send: EHLO observium.<privatedomain>.net
DEBUG: Recv: 250-mail.<privatedomain>.net Hello observium.<privatedomain>.net [10.0.255.26]
DEBUG: Recv: 250-SIZE 52428800
DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250 HELP
DEBUG: Send: MAIL FROM:<observium@<privatedomain>.net>
DEBUG: Recv: 250 OK
DEBUG: Send: RCPT TO:<network-admin@<privatedomain>.net>
DEBUG: Recv: 250 Accepted
DEBUG: Send: DATA
DEBUG: Recv: 354 Enter message, ending with "." on a line by itself
DEBUG: Send: MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_27b4fddf9ef5f436f9d311862d4a1eca"
From: observium@<privatedomain>.net
Return-Path: observium@<privatedomain>.net
To: network-admin@<privatedomain>.net
Subject: ALERT: [] []
Message-ID: <4000a7c3eb67f8c2fdc2cc0847df403d@observium.<privatedomain>.net>
Date: Thu, 12 May 2016 13:59:29 +0100
X-Priority: 3
X-Mailer: Observium 0.16.5.7833
Precedence: bulk
Auto-submitted: auto-generated
X-Auto-Response-Suppress: All
DEBUG: Send: --=_27b4fddf9ef5f436f9d311862d4a1eca
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
------------------------------------
ALERT
------------------------------------
Entity: =20
{{#ENTITY_DESCRIPTION}}
Description:=20
{{/ENTITY_DESCRIPTION}}
{{#CONDITIONS}}
Conditions: =20
{{/CONDITIONS}}
Metrics: =20
Duration: Unknown
------------------------------------
------------------------------------
Device: =20
Hardware: =20
OS: =20
Location: =20
Uptime: Never polled
------------------------------------
E-mail sent to: network-admin@<privatedomain>.net
E-mail sent at: Thu, 12 May 2016 13:59:29 +0100
--=20
Observium Professional 0.16.5.7833
--=_27b4fddf9ef5f436f9d311862d4a1eca
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=utf-8
<html>
<head>
<title>Observium Alert</title>
<style type=3D"text/css">
.observium{
width:100%; max-width: 500px; -webkit-border-radius: 5px; -moz-border-r=
adius: 5px; border-radius: 5px;
border:1px solid #DDDDDD; background-color:#FAFAFA; font-size: 13px; co=
lor: #777777;
}
.header{ font-weight: bold; font-size: 16px; padding: 5px; color: #555555=
; }
.red { color: #cc0000; }
#deviceinfo tr:nth-child(odd) { background: #ffffff; }
</style>
</head>
<body>
<table class=3D"observium">
<tbody>
<tr>
<td>
<table class=3D"observium" id=3D"deviceinfo">
<tbody>
<tr><td class=3D"header">ALERT</td><td><a style=3D"float: right;" href=
=3D"https://185.x.y.26/device/tab=3Dalert/">Modify</a></td></tr>
<tr><td><strong>Alert</strong></td><td class=3D"red"></td></tr>
<tr><td><strong>Entity</strong></td><td><a href=3D"" class=3D"entity-po=
pup " data-eid=3D"" data-etype=3D""></a></td></tr>
<tr><td><strong>Metrics</strong></td><td></td></tr>
<tr><td><strong>Duration</strong></td><td>Unknown</td></tr>
<tr><td colspan=3D"2" class=3D"header">Device</td></tr>
<tr><td><strong>Device</strong></td><td><a href=3D"https://185.x.y.26=
/device/" class=3D"entity-popup " data-eid=3D"" data-etype=3D"device"></a><=
/td></tr>
<tr><td><strong>Hardware</strong></td><td></td></tr>
<tr><td><strong>Operating System</strong></td><td> </td></tr>
<tr><td><strong>Location</strong></td><td></td></tr>
<tr><td><strong>Uptime</strong></td><td>Never polled</td></tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br /><p style=3D"font-size: 11px;">E-mail sent to: network-admin@<privatedomain>.net<br />
E-mail sent at: Thu, 12 May 2016 13:59:29 +0100</p>
<div style=3D"font-size: 11px; color: #999;">-- <br /><a href=3D"http://www=
=2Eobservium.org">Observium Professional 0.16.5.7833</a></div>
</body>
</html>
--=_27b4fddf9ef5f436f9d311862d4a1eca--
DEBUG: Send:
.
DEBUG: Recv: 250 OK id=1b0qDH-0004xI-C1
DEBUG: Send: QUIT
DEBUG: Recv: 221 mail.<privatedomain>.net closing connection
root@observium:/opt/observium#
_______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observiumOn Thu, May 12, 2016 at 1:51 PM, Adam Armstrong <adama@memetic.org> wrote:Use the test_alert.php script to test an alert entry with that notifier attached.
Adam.
Sent from BlueMail
On May 12, 2016, at 12:41, Andy Lemin <andy@brandwatch.com> wrote:Hi Adam,Thank you very much for your quick reply. However it is still not working :(I created an "Incoming Webhook" on the Slack site for our company, which injects messages to the "Private" channel "networks-private", with the username Network-Alerts.If I test the webhook with 'Curl' (as image below) it works fine and the test message appears in Slack (and on my mobile ;)But as you can see in my test below, I setup the contact the same as you, added an Alert checker, and then triggered some alerts. But none of them came through?Observium;
Command line test;
Slack App;
Really want to get this working with Observium as a method of notifying network alerts to my mobile.NB; This is an unmodified install of the paid version 0.16.5.7833Thanks very much for your time and thoughts.Cheers, Andy.On Thu, May 12, 2016 at 12:11 PM, Adam Armstrong <adama@memetic.org> wrote:Hi Andy,Getting slack to work is pretty straightforward, you just need a hook url and a channel name:Old screenshots died a week or two ago when the server they were on had a harddisk implosion! :)adam.On 12/05/2016 12:01:11, Andy Lemin <andy@brandwatch.com> wrote:
PS; Is there an up-to-date guide/manual for Observium and Slack? I must be missing something silly..The only one I can find is; https://rickheil.com/slack-and-observium-sitting-in-a-tree/However this is out of date and suggest modifying files, when the Integration is now finished I believe.Thanks, Andy._______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observiumOn Thu, May 12, 2016 at 11:55 AM, Andy Lemin <andy@brandwatch.com> wrote:Hi,Sorry for the slow reply.When I tried to look at your picture Adam, it says failed to connect?Do you know if this is permanent or only temporary? Still need to get Slack working (have been away on holiday :)Thanks, Andy.On Thu, Mar 10, 2016 at 7:56 AM, Henrik Cednert (Filmlance) <henrik.cednert@filmlance.se> wrote:Yepp. I've got it working. Confed at slack site and then like what adam showed you.
Have some fishy alerts but that's deeper than the slack notif and something with the polling of that device. But screenshot shows how the slack output looks/can look.
Cheers
--Henrik Cednertcto | td | compositor
Filmlance Internationalmobile [ + 46 (0)704 71 89 54 ]skype [ cednert ]
From: observium <observium-bounces@observium.org> on behalf of Adam Armstrong <adama@memetic.org>
Reply-To: Observium Network Observation System <observium@observium.org>
Date: Wednesday 9 March 2016 at 17:51
To: "observium@observium.org" <observium@observium.org>
Subject: Re: [Observium] Observium and Slack
http://alpha.memetic.org/~adama/snaps/Observium_Dev____Contact_-_Google_Chrome_2016-03-09_16.48.38.png
adam.
Sent from MailbirdOn 09/03/2016 15:33:43, Andy Lemin <andy@brandwatch.com> wrote:
Hi guys,_______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Has anyone gotten Slack Alert notifications working? We have email alerts working but not Slack. NB; Running the commercial version (0.16.2.7629).
We have a webhook URL for a private slack channel(x, y and z replaced for public viewing)
I tried the custom webhook "Contact", however we don't know how to transpose our slack webhook into the fields provided (URL, Authentication token, Sender of message).
There is no Authentication, and their is no Sender (the sender is defined by the webhook on the Slack side).
But only filling in the URL field with the webhook doesn't work :(Doing a "curl" test on the Observium server terminal with the webhook works fine?
Have also tried creating the new slack "Contact", But I have no idea how I'm supposed to transpose this webhook into the fields provided; (Channel name, Username, Instance URL).Assume this only works for public channels where you enter in user details for Observium instead of using a webhook.
Generally not sure how to debug this. Noobie..
Thanks, Andy.
_______________________________________________
observium mailing list
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
observium mailing list
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
_______________________________________________
observium mailing list
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