User Tools

Site Tools


nagios_integration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

nagios_integration [2016/06/14 16:35]
127.0.0.1 external edit
nagios_integration [2017/05/09 07:26] (current)
admin
Line 2: Line 2:
 This article explains how to integrate a standard Nagios (or Icinga) monitoring server with your FoxBox, in order to use it as an external SMS notification system. ​ This article explains how to integrate a standard Nagios (or Icinga) monitoring server with your FoxBox, in order to use it as an external SMS notification system. ​
  
-=== #1: Installation on the FoxBox side ===+==== #1: Installation on the FoxBox side ====
 Your FoxBox is specifically designed for these kind of communication tasks, thus there is not much to do here except: Your FoxBox is specifically designed for these kind of communication tasks, thus there is not much to do here except:
   * Providing a valid IP address, reachable from your monitoring server;   * Providing a valid IP address, reachable from your monitoring server;
   * Inserting a tested and full working SIM card, to send the SMS.   * Inserting a tested and full working SIM card, to send the SMS.
  
-=== #2: Installation on the Server side === +==== #2: Installation on the Server side ==== 
-First of all you need to place the script //​sendSMS.sh//​ (available [[http://​www.kdev.it/​sendSMS.tar.bz2|here]]) inside of the folder// /​usr/​lib/​nagios/​plugins/​ // giving it right permissions,​ in order to allow the Nagios user executing it.+First of all you need to place the script ​<wrap hi>//​sendSMS.sh//​</​wrap> ​(available [[http://​www.kdev.it/​sendSMS.tar.bz2|here]]) inside of the folder// /​usr/​lib/​nagios/​plugins/​ // giving it right permissions,​ in order to allow the Nagios user executing it. 
 + 
 +=== Resolving dependencies === 
 + 
 +The sendSMS.sh script required the perl LWP::​UserAgent library. This had to be installed through the command: 
 +<​code>​ 
 +apt-get install libwww-perl 
 +</​code>​ 
 + 
 +=== NTP and timezone configuration === 
 +Adjust NTP config and timezone through these commands: 
 +<​code>​ 
 +apt-get install ntp 
 +</​code>​ 
 +<​code>​ 
 +dpkg-reconfigure tzdata 
 +</​code>​ 
 + 
 +=== Notification setting ===
  
 Now you should add the new notification commands, working on the SMS channel instead of the classic email one. To do so, you need to add these lines to the file// /​etc/​nagios3/​commands.cfg //: Now you should add the new notification commands, working on the SMS channel instead of the classic email one. To do so, you need to add these lines to the file// /​etc/​nagios3/​commands.cfg //:
Line 25: Line 43:
  
 As you can see, you need a new information for the contacts: their phone number. Thus, you have to define it as "​pager"​ inside of the file// /​etc/​nagios3/​conf.d/​contacts_nagios2.cfg //. \\  As you can see, you need a new information for the contacts: their phone number. Thus, you have to define it as "​pager"​ inside of the file// /​etc/​nagios3/​conf.d/​contacts_nagios2.cfg //. \\ 
 +
 Moreover, you need to set up the service/​host notification command. By default these are using the email channel, while we want to alert with the SMS one, thus you have to edit the parameters // "​service_notification_commands"//​ and// "​host_notification_commands"​ //​too: ​ Moreover, you need to set up the service/​host notification command. By default these are using the email channel, while we want to alert with the SMS one, thus you have to edit the parameters // "​service_notification_commands"//​ and// "​host_notification_commands"​ //​too: ​
 <​code>​ <​code>​
Line 37: Line 56:
         }         }
 </​code>​ </​code>​
 +
 +==== #3: Restarting Nagios ====
  
 The configuration is now complete. Obviously, you have to restart the Nagios service in order to see its effects, using: The configuration is now complete. Obviously, you have to restart the Nagios service in order to see its effects, using:
nagios_integration.txt · Last modified: 2017/05/09 07:26 by admin