nagios server redundancy

Giacomo Montagner gmontagner at sorint.it
Wed Feb 16 11:40:09 CET 2011


On Mon, 14 Feb 2011 16:53:59 -0500
Morty <morty+nagios at frakir.org> wrote:

> Interesting.  Do you have example code?  I'm currently using a file
> backend, but I could switch to a DB backend if necessary.
> 
> - Morty

Hi all, 
sorry for double-answering, but I found out NSCA is not able to 
forward things other than host/service checks, so I managed to 
forward acknowledgments in another way. It's still based on the 
NDOUtils-maintained MySQL DB. 

First: setup the machine which is receiving acks
- put the following line in /etc/services:
  get_acks	15667/tcp			# get acks from other server

  (I chose that port by putting a "1" before NSCA standard port). 

- put get_acks.pl into <nagios_base_dir>/bin (on my machines it's 
  /opt/nagios/bin) or wherever you prefer; modify the line:

  my $cmd = '/opt/nagios/var/rw/nagios.cmd';

  to match your environment (i.e. put there the right path to the external commands
  file); 

- put get_acks into /etc/xinetd.d, modify the lines:

  server          = /opt/nagios/bin/get_acks.pl		# Path to script
  only_from       = 127.0.0.1 192.168.0.1

  to match your environment (list the IP of the sending server on the second line);

- start/restart xinetd; verify it's listening on port 15667 (or whichever you chose). 


Second: setup the sending machine
- Put replicate_acks.pl wherever you prefer; modify the configuration in it to match 
  your environment (MySQL db location, user, password, etc.). 
  Schedule it to run automatically. If the receiving machine is processing external commands, 
  it should start receiving acknowledgments as well. 
  Please notice that the script must be able to write to a lock/status file, it's in the 
  config. 


I did not test it thoroughly, but it seemed to work at least one time. It might be buggy :)


Hope this helps. 

Bye. 
Giacomo


-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_acks
Type: application/octet-stream
Size: 450 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110216/046fd4e0/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_acks.pl
Type: application/x-perl
Size: 711 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110216/046fd4e0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: replicate_acks.pl
Type: application/x-perl
Size: 3923 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110216/046fd4e0/attachment-0001.bin>
-------------- next part --------------
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list