Welcome to docs.opsview.com

Opsview Shutdown and Startup

There are two services on an Opsview master server:

  • opsview - which runs the background daemons for monitoring, including an agent on the master
  • opsview-web - which runs the application server to serve the web pages

If you run these commands as the nagios user, make sure you use su - nagios (with the dash) to switch to the nagios user as you will need the environment variables to be setup.

Shutdown

Master shutdown

To shutdown, you can run the commands as either the root user or the nagios user:

/etc/init.d/opsview stop
/etc/init.d/opsview-web stop

Slave shutdown

To stop Opsview on all slave systems, run as the nagios user on the master server:

/usr/local/nagios/bin/dosh /usr/local/nagios/bin/rc.opsview stop

Startup

Master startup

To start Opsview on the master, run as the nagios user:

/etc/init.d/opsview start
/etc/init.d/opsview-web start

Slave startup

To start Opsview on all slave systems, run as the nagios user on the master server:

/usr/local/nagios/bin/dosh /usr/local/nagios/bin/rc.opsview start

Opsview Server Shutdown

To shutdown your Opsview server, use the appropriate OS shutdown routine. Opsview will install an appropriate handler to shut Opsview down as part of the OS shutdown. An appropriate handler will also be run as part of an OS startup.

Note: Slaves will continue to run and do local notifications as an OS shutdown does not stop slaves from running. See the steps above to shutdown slaves.

Troubleshooting

I get the message "Environment not set properly", when running the start/stop scripts

When you run the init script and you get this message:

Environment not set properly. Check nagios user's profile

This means that the nagios user does not have the Opsview profile sourced correctly. To resolve, change to the nagios user and check that the .profile, .bash_profile AND .bashrc file (based on your OS) has the following line:

test -f /usr/local/nagios/bin/profile && . /usr/local/nagios/bin/profile

You can check if the environment has been sourced correctly by checking the OPSVIEW_BASE variable:

# su - nagios
$ echo $OPSVIEW_BASE
/usr/local/nagios

As root, check if the error now occurs:

# /etc/init.d/opsview status
Nagios is running
Navigation
Print/export
Toolbox