Automatic Nagios Downtime schedulation script

Posted by on nov 28, 2011 in Senza categoria | 0 comments

This blog article presents a little tool that might be useful to automatize tasks around Nagios. In every day’s IT administrator tasks the reboot and downtime for servers and services maintenance is not avoidable.

One of the administration tasks in NetEye is also the schedulation of such downtimes in order to avoid predictable alert notifications via eMail and SMS, but also to respect the downtime periods for your SLA statistics.

Here I would like to introduce a little script that allows to setup downtime periods in a direct way via command line. For even repeated events it would be possible to accomplish via cron job.

The script call itself requires just the essential information: The name of the host and the service for which is needed to schedule the downtime. Additional arguments might be the Downtime comment description and the duration.
A possible command call would be:  ./ <nagios host> <nagios service> [<comment> <seconds of downtime>]

[root@neteye ~]# ./ neteye Current+Users Downtime+for+maintainance 7200

You can note that Host and Service Names with non basic-ASCII characters special encoding is required. The replacement for a space is for example a “+”. The result would be  as shown below:

To facilitate the discovery of problems the script execution results are kept in a local logfile in /tmp. Just read the file to extract the last execution html:

[root@neteye ~]# cat /tmp/nagios_downtime.log


Get the script

You can download the script here:

Just copy it somewhere on your NetEye ( or Nagios installation ) and define within the first lines a few initial things:

  • the URL to the local or remote cgi
  • The user to authenticate
  • The password

That’s it. Now the script should be ready. If the web server’s authentication is correct and the server returns some strings the content is logged in the /tmp/nagios_downtime.html

Read More

Sendmail with external relay (authentication and encryption)

Posted by on nov 14, 2011 in NetEye | 0 comments

Spesso capita di ritrovarsi a configurare l’invio di email su server relay, che richiede autenticazione e crittazione. Perciò penso che i seguenti passaggi possano essere utili per riuscire in questo intento.

Innanzitutto inserire nel file /etc/mail/ :

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

in seguito creare la cartella per contenere i dati di autenticazione:

# mkdir /etc/mail/auth

e creare un file client-info

# vim /etc/mail/auth/client-info

con il seguente contenuto: "U:root" "I:<USERNAME>" "P:<PASSWORD>"

specificando  "<USERNAME>" e "<PASSWORD>"  del relay server.

Infine eseguire i seguenti comandi per rendere effettive le impostazioni e configurare i permessi corretti:
# cd /etc/mail/auth
# makemap hash client-info < client-info
# chmod 700 /etc/mail/auth
# chmod 600 /etc/mail/auth/*
# /etc/init.d/sendmail restart

Read More


Posted by on nov 9, 2011 in NetEye Updates | 0 comments

* Thu Oct 06 2011 Juergen Vigna <>
– Added missing nagios cgi options to cgi options form.
– Remove building of auto requirements

* Tue Aug 16 2011 Patrick Zambelli <>
– Fix of configuration in Monarch DB: Obsessive handler commands definition

Read More