![]() Lastly, we will apply the notification to one of our Opsview users by navigating to the Contact settings page. It could be used for any alerts on your systems.įor a complete guide to configuring alerts, read our “Opsview Notifications & Setting Up Alerts” guide. Here at Opsview, we are using the light to alert us to new tickets coming into our customer success team so we know about them right away. In this example, I am using a keyword named ServiceCloud. You will then need to select a system to notify against. I have named it raspberrypi in this example. Give the profile a name, select the role you would like to make the profile available to, and select the notification method in the “Notify by” section. Next, we configure the Shared Notification Profile by navigating to the Shared Notification Profiles page.Ĭreate a new Shared Notification Profile using the green plus in the top left corner. We will configure this variable later in the contact settings. You will notice that we are using a “Contact Variables” named “RASPBERRY_URL”, this will be the url that we will pass to the notification script so it is able to turn the light on and off. Example settings for the new method are shown below: To use the new script, add a new notification method by clicking the green cross in the top left hand corner of the notification methods page. Once the notification script has been created, you can configure the Notification Methods. The script needs to be owned by the Nagios user: # chown nagios:nagios /usr/local/nagios/libexec/notifications/notify_by_Īnd have read and execute permissions set: # chmod u+rx /usr/local/nagios/libexec/notifications/notify_by_ The script needs to be placed in the directory: Opsview configurationįirst, you will need to add the notification script to your Opsview system. To call the CGI script from your web browser: This should turn the lights on. # sudo /usr/bin/python /usr/lib/cgi-bin/LightsOff.py You can test the scripts by running them directly on the Pi: # sudo /usr/bin/python /usr/lib/cgi-bin/LightsOn.py To control the Raspberry Pi’s io, you must have elevated access rights so we run the scripts as root, to do this you must add www-data to the sudoers file:Īnd add the entry: www-data ALL=(ALL) NOPASSWD: /usr/bin/python.# chown www-data: www-data /usr/lib/cgi-bin/* # tar –cvf OpsviewLights.tar –C /usr/lib/cgi-bin/ Download the scripts, you can find them here.# sudo apt-get update # sudo apt-get install apache To configure the Pi with this script: # chmod u+x /usr/lib/cgi-bin/* You will need a script on the Pi that can be called by Opsview to turn the light on and off, this is a Perl script that can be triggered by making web calls to the Pi. ![]() You will need access to the internet to download some packages and scripts.įirstly, on the Pi we need to wirelessly connect the controller board to the remotely controlled socket. Then, configure networking on the Pi so you can reach it from your Opsview system. Install an operating system onto the Pi, we used Raspbian. Plug the light into the remotely controlled socket. Remote control sockets – Plugs straight into the Raspberry Pi and can turn on and off your light.įirst, just plug the plug socket controller into the Raspberry Pi, it fits straight onto the io header.Raspberry Pi – Easy to set up and configure, Raspberry Pi is an affordable credit card–sized single-board computer used to drive your lights.Who wouldn’t be keen to getting some disco equipment in the office! Flashing light – These can easily be found online, ours actually came from an online disco equipment store.Opsview – An install of Opsview, which is set up to monitor whatever it is you really need to know about.However, nothing can beat a massive flashing light! Make sure none of your alerts are ever missed again by anyone in your office (or a ten block radius for that matter!). Dashboards and reports are brilliant ways to keep an eye on your systems, and an e-mail or ticket straight into your ticketing system lets you know about critical issues.
0 Comments
Leave a Reply. |