How to notify myself if NSD dies unexpectedly?

Hello,

I run this big site which has been down for days now without my knowledge due to this:

[1393533384] nsd[1014]: notice: nsd started (NSD 3.2.15), pid 1014
[1394026594] nsd[1014]: warning: server 1060 died unexpectedly with status 9, restarting
[1394026594] nsd[1014]: error: fork failed: Cannot allocate memory
[1394113596] nsd[1014]: warning: signal received, shutting down…

Restarted NSD manually just now and everything is fine. But does anybody know of ways I can notify myself should this happen again?

Thanks!

O.D.

How about monitoring your server with something like Nagios or Icinga
using their DNS plugins? If you don't want to run a full Nagios or
Icinga server, you might want to look at a service such as Pingdom,
which can monitor things for you and send you reports.

Anand

nsd4 can be started without forking, so an init systems like systemd can
get restarted by them. With systemd that would be Type=Simple

For nsd3, this is not possible due to its forking and mishandling of pid
files.

Paul

a message of 54 lines which said:

But does anybody know of ways I can notify myself should this happen
again?

IMHO, there is nothing nsd-specific. You just use a generic monitoring
framework. I use Icinga <http://www.icinga.org/&gt; but there are many
others.

Like most tools, Icinga accepts the Nagios API so you can use the
Monitoring plugins (former Nagios plugins)
<https://www.monitoring-plugins.org/&gt; I use an unmodified check_dns,
configured that way in Icinga:

define service{
        use generic-service
        host_name mononoke
        service_description DNS4
        check_command check_dig!-4 -l eu.org -T SOA -A +dnssec
        }

define service{
        use generic-service
        host_name mononoke
        service_description DNS6
        check_command check_dig!-6 -l eu.org -T SOA -A +dnssec
        }

Paul Wouters:

For nsd3, this (running nonforking) is not possible due to its forking and mishandling of pid
files.

you could run nsd3 nonforking too *if* you do not work as slave receiving new data via dns updates.
Any new data require a exit and restart of nsd3.

Andreas