SOLVED Install Graylog2 Plugin

Status
Not open for further replies.

Caleb

Member
Sep 12, 2017
42
17
8
WA, USA
We use a Graylog2 server, and it has been on our wishlist to get the logs from FreeSwitch to our Graylog server. FreeSwitch has a "graylog2" module (see https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/src/mod/loggers/mod_graylog2), but unfortunately that mod does not come with the FusionPBX install. My first attempt was to build the individual module and add it to our existing installation, but that proved to be unnecessarily difficult. While chatting with some FreeSwitch support guys, they told me of the freeswitch-mod-graylog2 and freeswitch-mod-graylog2-dbg packages. Installing those on our Debian 8 system that runs FusionPBX required a ton of updates to FreeSwitch packages, which ended up generating errors in the log (I think they were minor, but errors nonetheless).

So here's what I did to get it set up correctly:
  1. Setup a temporary FusionPBX system identical in specs to your existing system
    • If your existing system is virtualized like ours, you can just make a copy of it and stick it in an isolated network that has internet access
  2. On the temp system, run (using sudo or su) apt-get install freeswitch-mod-graylog2 freeswitch-mod-graylog2-dbg
  3. Copy the following files from the temp system to your production system (unless you've changed the default paths on either system, the paths below should be the same on both):
    • /usr/lib/debug/usr/lib/freeswitch/mod/mod_graylog2.so
    • /usr/lib/freeswitch/mod/mod_graylog2.so
    • /etc/freeswitch/autoload_configs/graylog2.conf.xml
  4. Edit autoload_configs/graylog2.conf.xml as needed
  5. In the FusionPBX web GUI, go to Advanced > Modules, and click the + button under Loggers
  6. Fill in these values:
    • Label: Graylog2
    • Module Name: mod_graylog2
    • Order: 800
    • Module Category: Loggers
    • Enabled: true
    • Default Enabled: true
  7. Click Save
  8. Scroll down to the Loggers section and verify Graylog2 has been started
    • If Graylog2 won't start, use fs_cli or the log files to troubleshoot

Disclaimer: there's a slight possibility I may have missed a step or two, as I very well could have affected the process with previous attempts to get mod_graylog2 setup.

Feel free to contribute if you've got a better method to accomplishing the same purpose!
 
Last edited:
Status
Not open for further replies.