Welcome to docs.opsview.com

This is an old revision of the document!


Configuration

Configuration is tricky, because it depends on the purposes of the server. These instructions are split based on the type of server.

There is configuration required to:

  • activemq (the messaging system), to define connectivity between other instances
  • activemq consumers (our own scripts to handle messaging submission and processing)
  • sec, to tell it to run

Stomp is the protocol we will use to communicate from our perl scripts to the messaging system, hence needing it in all instances of the messaging server.

Opsview Master

Logview web application

Grant appropriate access to logview mysql user:

GRANT ALL ON logview.* TO logview@'%' IDENTIFIED BY 'changeme';
FLUSH PRIVILEGES;

In /opt/opsview/logview/logview_web_local.yml, set mysql password from above (3rd line after connect_info:). Set authtkt's details to be same as Opsview's.

Create database

/opt/opsview/logview/bin/db_logview db_install

Startup the web application:

/etc/init.d/opsview-logview start

Add proxy definition into apache's configuration for opsview:

Alias /logview/javascript "/opt/opsview/logview/root/static/javascript"
Alias /logview/stylesheets "/opt/opsview/logview/root/static/stylesheets"
Alias /logview/images "/opt/opsview/logview/root/static/images"
ProxyPass /logview/javascript !
ProxyPass /logview/stylesheets !
ProxyPass /logview/images !
ProxyPass /logview http://localhost:4000/ retry=5
ProxyPassReverse /logview http://localhost:4000/

This must go before the ProxyPass / directive.

Activemq

Copy /opt/opsview/activemq/conf/activemq.xml.example to /opt/opsview/activemq/conf/activemq.xml and amend this section:

<transportConnectors>
 <transportConnector name="openwire" uri="tcp://localhost:4125"/>
 <transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>

In addition, the ssh tunnel to slaves will include a port forwarding of the slave 4125 to master 4125. This is done in opsviewd.

Startup the messaging system:

/etc/init.d/opsview-activemq start

Also create the queues for forwarding:

su - opsview
mkdir -p /var/opt/opsview/activemq/spool/topic/sec.commands
/etc/init.d/opsview-file2activemq start

This server needs to listen for nagios alerts and logview events:

su -
echo "nagios:/opt/opsview/activemq/bin/consume_nagios_alerts" > /etc/opt/opsview/activemq/consumers.d/consume_nagios_alerts
echo "opsview:/opt/opsview/activemq/bin/consume_logview_events" > /etc/opt/opsview/activemq/consumers.d/consume_logview_events
/etc/init.d/opsview-activemq-consumers start

Slave

<transportConnectors>
 <transportConnector name="openwire" uri="tcp://{hostname}:61616" />
</transportConnectors>
<networkConnectors>
 <networkConnector name="master" uri="static://(tcp://localhost:4125)" duplex="true" networkTTL="2"/>
</networkConnectors>

So, listen for stomp communication and setup a connect to the opsview master. duplex means the master can send messages to the slave. networkTTL means the number of brokers a message can pass through.

Slave needs to listen on 61616 to allow the syslog server to connect to it.

Startup the messaging system:

/etc/init.d/opsview-activemq start

Syslog server

<transportConnectors>
 <transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>
<networkConnectors>
 <networkConnector name="slave" uri="static://(tcp://slave:61616)" duplex="true" networkTTL="2"/>
</networkConnectors>

So the syslog server connects to the slave to get to the cloud.

Start up the messaging system:

/etc/init.d/opsview-activemq start

Also create the queues for forwarding:

su - opsview
mkdir /var/opt/opsview/activemq/spool/queue/nagios.alert
mkdir /var/opt/opsview/activemq/spool/queue/logview.events
/etc/init.d/opsview-file2activemq start

This server needs to listen for sec events:

su -
echo "root:/opt/opsview/activemq/bin/consume_sec_events" > /etc/opt/opsview/activemq/consumers.d/consume_sec_events
/etc/init.d/opsview-activemq-consumers start

(Maybe instead of root, you use opsview user and set appropriate permissions to allow user to read log files)

Set SEC to run. Edit /etc/default/opsview-sec and edit:

RUN="yes"

Then startup SEC. We just put default logfiles and rules in for now:

cd /opt/opsview/sec/conf
cp rules.sec.dist rules.sec
cp logfiles.sec.dist logfiles.sec
/etc/init.d/opsview-sec start
Navigation
Print/export
Toolbox