Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Nagios Perfect Scheduler
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


This might eventually become the perfect scheduler for Nagios.

Currently, it is a proof of concept. I had problems with my distributed
Nagios check hosts not starting enough checks per second, and just couldn't
figure out how to get them to start more. They were not overloaded, but
not even with all the might of Google search could I figure out how to
get them to run more services per time unit.

So - I wrote this small scheduler that runs checks for me, and sends the
results to the Nagios master using the same mechanism as a Nagios slave
server would (using NCSA).

Configuration :

You have to produce a file looking like this :

  {nagios_check, "", "PING", "/usr/lib/nagios/plugins/check_ping", ["-H", "", "-w", "100.0,20%", "-c", "500.0,60%", "-p", "5"]},
  {nagios_check, "", "PING", "/usr/lib/nagios/plugins/check_ping", ["-H", "", "-w", "100.0,20%", "-c", "500.0,60%", "-p", "5"]},
  {nagios_check, "", "CPU_Usage", "/usr/lib/nagios/plugins/check_nrpe", ["-H", "", "-c", "CPU_Usage"]},
  {nagios_check, "", "LDAP", "/usr/lib/nagios/plugins/check_ldap", ["-H", "", "-b", "dc=example,dc=org"]}

Since this is currently only a proof of concept, I went for the kind of
syntax that was easiest to parse using my language of choice. I know it
is a bit awkward for most of the human population, but that's the way
it currently is.

Then, edit the OPTIONS in npers.erl. Most of all, verify the send_result_cmd.

After that, run approximately this :

  $ apt-get install erlang
  $ erlc *.erl
  $ erl

You will now get an Erlang shell. Enter "npers:start()." on the prompt :

  1> npers:start().

You will see a bunch of "PROGRESS REPORT", and then the next prompt.


To get back to your UNIX shell, press Ctrl+C twice. To ask npers what's
going on, execute "npers_spawner:info()." :

  2> npers_spawner:info().

Here we see that one check will be started every 50 ms, to reach the goal of
starting all my 7359 checks in 400 seconds.

To change the interval without restarting, do "npers_spawner:set_interval(300)."

My numbers are from a VMware ESX virtual machine with 2 CPUs and 512 MB of RAM.
The CPU is reported to be 2,4 GHz Dual-Core AMD Opteron(tm) Processor 8218.

Going from one to two CPUs, and stopping the Nagios process competing for
resources on the same machine roughly trippled how many checks I could run
without overloading the machine.
Something went wrong with that request. Please try again.