Categories
windows

Monitor Windows Service from Nagios

install nsclient with nrpe
allow port tcp 5666 on firewall

Put check_winservice.exe in Program Files\NSClient++\scripts

Edit nsclient.ini as admin:
[/settings/external scripts/scripts]
check_adss=check_winservice.exe –service ADSelfServicePlus –warning 200 –critical 600

restart nsclient

test from nagios

su – nagios
cd /usr/local/nagios/libexec
./check_nrpe -H 192.168.1.10 -c check_adss
SERVICE OK – 1 service(s).|’services’=1;200;600

Categories
linux perisian rangkaian

Contoh konfigurasi ringkas Nagios pada Debian

monitor-nrpe

Server Nagios: 192.168.1.110
Server DNS: 192.168.1.102

Contoh berikut adalah untuk memantau load, bilangan user yang log in, baki kapasiti root partition, jumlah proses sedang berjalan dengan menggunakan nrpe

    Pada server Nagios (Wheezy):

  1. Install pakej-pakej yang diperlukan:
    apt-get install nagios3 nagios-plugins nagios-nrpe-plugin
  2. Buatkan fail /etc/nagios3/conf.d/dns-mylab.cfg seperti berikut:

    [code lang=’plain’]define host{
    use generic-host
    host_name dns
    alias dns-mylab
    address 192.168.1.102
    }
    define service{
    use generic-service
    host_name dns
    service_description Current Load
    check_command check_nrpe_1arg!check_load
    }
    define service{
    use generic-service
    host_name dns
    service_description Current Users
    check_command check_nrpe_1arg!check_users
    }
    define service{
    use generic-service
    host_name dns
    service_description Disk Space
    check_command check_nrpe_1arg!check_root
    }
    define service{
    use generic-service
    host_name dns
    service_description Total Processes
    check_command check_nrpe_1arg!check_total_procs
    }[/code]

  3. Mulakan semula servis nagios
    /etc/init.d/nagios3 restart

    Pada server DNS (squeeze):

  1. Pasang pakej-pakej yang diperlukan
    apt-get install nagios-nrpe-server nagios-plugins
  2. Edit /etc/nagios/nrpe.cfg seperti dibawah dengan mengambil kira output “df -h”, IP server nagios & IP server DNS

    [code lang=’plain’]#server_address=127.0.0.1
    server_address=192.168.1.102

    #allowed_hosts=127.0.0.1
    allowed_hosts=192.168.1.110

    #command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
    command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/debian-root[/code]

  3. Mulakan semula servis nrpe
    /etc/init.d/nagios-nrpe-server restart