Is it possible to configure nagios business process (nagiosbp) to use a tcp socket instead of a unix socket?

153 Views Asked by At

I'm looking to use NagiosBP nagios business process addon in conjunction with the NagVis addon. My nagios server is remote and exporting nagios data via mklivestatus via a tcp port.

NagVis is easily configured to use the tcp socket, but NagiosBP appears to be only configurable to use a local unix socket. Is there a way to configure NagiosBP to use the tcp socket ?

1

There are 1 best solutions below

0
On

ndodb.pm needs to be modified to allow use of the TCP socket e.g.

            my @livestatus = split(':',$dbparam{'ndo_livestatus_socket'});

            if ($livestatus[0] eq 'tcp') {
              $socket = IO::Socket::INET->new ("PeerHost" => $livestatus[1], "PeerPort" => $livestatus[2], "Proto" => $livestatus[0], "Type" => SOCK_STREAM, "Timeout" => 15) or die "unable to connect to tcp socket \"" . $dbparam{'ndo_livestatus_socket'} . "\": $!\n";
            } else {
              $socket = IO::Socket::UNIX->new ("Peer" => $dbparam{'ndo_livestatus_socket'}, "Type" => SOCK_STREAM, "Timeout" => 15) or die "unable to connect to unix socket \"" . $dbparam{'ndo_livestatus_socket'} . "\": $!\n";
            }

There are 3 places in the ndodb.pm file that need to be modified to enable this.