Action Hero and Sensu Integration

41 views
Skip to first unread message

carlos....@nbrsolutions.pt

unread,
Apr 11, 2016, 6:34:48 AM4/11/16
to actionHero.js
Hello,

I would like to know if someone has worked on integrating the actionhero hero log with the sensu monitoring infrastructure?

Thanks

Evan Tahler

unread,
Apr 11, 2016, 12:16:50 PM4/11/16
to actionHero.js
Not that I've seen, but they have a REST API [[ https://sensuapp.org/docs/latest/events#event-data ]] so using an actionhero middleware to post data to them as part of every request would be very simple... or you could batch data to them using the task system.  Sensu also seems to have a very similar mode of operation to Server Density and other related services which I have seen folks integrate into actionhero... I wouldn't anticipate a problem. 

carlos....@nbrsolutions.pt

unread,
Apr 12, 2016, 4:28:11 AM4/12/16
to actionHero.js

I'm not inclined to use Sensu REST API's. I would like real time scenarios. Do you have another suggestion? I have read about centralizing logs on logstash...do you think it's a viable option?

Thanks 

Evan Tahler

unread,
Apr 12, 2016, 11:45:15 AM4/12/16
to actionHero.js
Sure, I've used LogStash, Sumologic, Splunk, and a few other log-aggregation tools.  They all work great.

carlos....@nbrsolutions.pt

unread,
Apr 12, 2016, 12:12:30 PM4/12/16
to actionHero.js
Hello Evan,

Sorry but can you elaborate some more.

How can be the flow between pieces? What I mean is how can ActionHero send logs to logstash/graylog or whatever aggregation log I decide to use so then from this tool I can send information to sensu for instance.

Do I need to implement a initializer for this? A middleware? I've been trying to put the pieces together in my mind but I came up short. :(

Thanks

Evan Tahler

unread,
Apr 12, 2016, 12:25:23 PM4/12/16
to actionHero.js
All of the tools mentioned run in a few ways.  Thier default behavior is that you run a separate process (the Logstash agent is a ruby application for example) which you run on the same server as your actionhero serers.  You tell the logstash agent to read in the normal actionhero log files, and it uploads them to elasticsearch for you to view later. 

As an alternative to running the collector/agent on your server, actionhero uses winston as our logger, and it has its own plugin system to forward logs off to other collectors.  For example you can add a plugin to winston/actionhero to skip the logstash collector and write directly to elasticsearh https://www.npmjs.com/package/winston-logstash

carlos....@nbrsolutions.pt

unread,
Apr 12, 2016, 12:39:22 PM4/12/16
to actionHero.js
I need the dependency of logstash or graylog because I need to foward logs to sensu for it generate alerts. By the way I run logstash/ graylog as a server it's also possible to consume the actionhero logs remotely ? I ask this because it's true that I could run as an agent but I don't want to put that kink of process running on the actionhero servers.

Thanks

Michael Jensen

unread,
Apr 12, 2016, 1:44:04 PM4/12/16
to carlos....@nbrsolutions.pt, actionHero.js
If it helps, we use syslog to ship the logs from Actionhero instances to our centralized logging pipeline (which uses Logstash). There's a Syslog plugin for Winston which you can use for this.

We initialize the syslog winston plugin in an actionhero initializer.

--
You received this message because you are subscribed to the Google Groups "actionHero.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to actionhero-j...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

carlos....@nbrsolutions.pt

unread,
Apr 13, 2016, 5:17:11 AM4/13/16
to actionHero.js, carlos....@nbrsolutions.pt
Hello Michael,

I have seen this examples that bypasses the concept of ah initializer and syslog plugin


How you send the logs via syslog to logstash?

Michael Jensen

unread,
Apr 14, 2016, 5:35:15 PM4/14/16
to carlos....@nbrsolutions.pt, actionHero.js
I'm not sure specifically how it's set up here (the centralized logging pipeline is managed by another team), but Logstash appears to support collecting messages from Syslog: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-syslog.html 
Reply all
Reply to author
Forward
0 new messages