Merhaba, FreeBSD üzerinde nrpe calistirmanin en güzel yolu kurulumu ports'tan yapmaktir. Sisteminizede ports kuruluysa, cd /usr/ports/net-mgmt/nrpe2 dizini altindan make install clean seklinde kurulumu yapabilirsiniz. Not: Nrpe paketini kurdugunuz zaman nagios-plugins paketi de kurulmaktadir.
Ports kurulu degilse, portsnap ile kolayca kurabilirsiniz. Bkz: http://www.freebsd.org/doc/en/books/handbook/portsnap.html Bkz: http://blog.cagriersen.net/2008/06/using-portsnap/ Kurulum sonrasinda, baslangic scripti /usr/local/etc/rc.d/ dizini altinda nrpe2 adiyla olusturulur. Acilislarda otomatik olarak baslatilmasi icin rc.conf dosyasina nrpe2_enable="YES" satirini girmeniz gerekir. Ornek conf dosyasi; /usr/local/etc/ dizini altinda nrpe.cfg-sample ismi ile duruyor. Dosyanin adnini nrpe.cfg yapmalisiniz. Dosyada allowed_hosts şeklinde bir satır var. Burada, nagios sunucunuzun ip adresini girmeniz ve nrpe'ye erismesine izin vermeniz gerekiyor. Ayrica, default tanimli kontrol satirlari asagidaki gibi: command[check_users]=/usr/local/libexec/nagios/check_users -w 5 -c 10 command[check_load]=/usr/local/libexec/nagios/check_load -w 15,10,5 -c 30,25,20 command[check_root]=/usr/local/libexec/nagios/check_disk -w 20% -c 10% -p / command[check_var]=/usr/local/libexec/nagios/check_disk -w 20% -c 10% -p /var command[check_tmp]=/usr/local/libexec/nagios/check_disk -w 20% -c 10% -p /tmp command[check_usr]=/usr/local/libexec/nagios/check_disk -w 20% -c 10% -p /usr command[check_zombie_procs]=/usr/local/libexec/nagios/check_procs -w 5 -c 10 -s Z command[check_total_procs]=/usr/local/libexec/nagios/check_procs -w 150 -c 200 Gördüğünüz gibi default olarak kontrol edilecek konular bunlar. Eşikleri kendinize göre ayarladıktan sonra nrpe'yi start etmeniz gerekiyor. /usr/local/sbin/nrpe2 -c /usr/local/etc/nrpe.cfg -d komutu ile bunu yapabilirsiniz. Nrpe 5666. portu dinler, dolayisi ile calisip calismadigina netstat -an |grep 5666 komutu ile bakabilirsiniz. Cikti asagidaki gibi olmalidir. tcp4 0 0 *.5666 *.* LISTEN nrpe sorunsuz olarak calisiyorsa, nagios sunucusu tarafindaki ayarlari yapabilirsiniz. Nagios sunucunuzda yapmaniz gereken ayarlamalar sunlar. /usr/local/nagios/etc/objects dizininde monitor edeceginiz makine icin ornegin sunucuadi.cfg ismi ile bir conf dosyasi olusturmaniz gerekiyor. Temel kontrolleri yapan ornek bir conf dosyasi icerigi asagidaki gibidir: define host{ use nix-server host_name SUNUCUADI alias SUNUCUADI / FreeBSD 7.0 address BİLGİSAYARIN IP ADRESİ define service{ use nix-generic-service host_name SUNUCUADI service_description CPU Load check_command check_nrpe!check_load } define service{ use nix-generic-service host_name SUNUCUADI service_description Current Users check_command check_nrpe!check_users } define service{ use nix-generic-service host_name SUNUCUADI service_description / Free Space check_command check_nrpe!check_root } define service{ use nix-generic-service host_name SUNUCUADI service_description /usr Free Space check_command check_nrpe!check_usr } define service{ use nix-generic-service host_name SUNUCUADI service_description /var Free Space servicegroups DISK check_command check_nrpe!check_var } define service{ use nix-generic-service host_name SUNUCUADI service_description Total Processes check_command check_nrpe!check_total_procs } define service{ use nix-generic-service host_name SUNUCUADI service_description Zombie Processes check_command check_nrpe!check_zombie_procs } use nix-server, use nix-generic-service kisimlari, daha onceden templates.cfg dosyasinda tanimlanmis on tanimli ayarlari almaktadir. Bu ornek icin templates.cfg dosyasindaki ilgili kisimlarin icerigi su sekilde; kendiniz de sunucu gruplari icin ozel tanimlamalar yapabilirsiniz. define host{ name nix-servers ; The name of this host template use generic-host ; Inherit default values from the generic-host template check_period 24x7 ; By default, Windows servers are monitored round the clock check_interval 5 ; Actively check the server every 5 minutes retry_interval 1 ; Schedule host check retries at 1 minute intervals max_check_attempts 10 ; Check each server 10 times (max) check_command check-host-alive ; Default command to check if servers are "alive" notification_period 24x7 ; Send notification out at any time - day or night notification_interval 30 ; Resend notifications every 30 minutes notification_options d,r ; Only send notifications for specific host states contact_groups admins,SMS ; Notifications get sent to the admins by default hostgroups nix-servers ; Host groups that Windows servers should be a member of register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE } define service{ name nix-generic-service ; The 'name' of this service template active_checks_enabled 1 ; Active service checks are enabled passive_checks_enabled 1 ; Passive service checks are enabled/accepted parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems) obsess_over_service 1 ; We should obsess over this service (if necessary) check_freshness 0 ; Default is to NOT check service 'freshness' notifications_enabled 1 ; Service notifications are enabled event_handler_enabled 1 ; Service event handler is enabled flap_detection_enabled 1 ; Flap detection is enabled failure_prediction_enabled 1 ; Failure prediction is enabled process_perf_data 1 ; Process performance data retain_status_information 1 ; Retain status information across program restarts retain_nonstatus_information 1 ; Retain non-status information across program restarts is_volatile 0 ; The service is not volatile check_period 24x7 ; The service can be checked at any time of the day max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state normal_check_interval 10 ; Check the service every 10 minutes under normal conditions retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined contact_groups admins,SMS ; Notifications get sent out to everyone in the 'admins' group notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events notification_interval 120 ; Re-notify about service problems every hour notification_period 24x7 ; Notifications can be sent out at any time register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! } Bu asamalari tamamladiktan sonra, nagios.cfg dosyasinda olusturgudunuz sunucuadi.cfg dosyasini belirtmeniz gerekiyor. cfg_file=/usr/local/nagios/etc/objects/sunucuadi.cfg Sonrasinda, nagios servisini yeniden baslatmaniz gerekiyor. Herhangi bir sorun olmadiysa sistemi monitorlemeye baslamaniz gerekiyor. (Elbette ben de anlatirken bir seyler atlamadiysam.) Mailinizde anlattiginiz diger konularda; Ubuntu tarafinda aldiginiz hata nrpe'nin calismadigini gosteriyor sanirim. NRPE'nin ilgili portu dinledigine emin olmanizi oneririm. FreeBSD tarafinda aldiginiz hatanin nedeni NRPE'yi SSL destegi ile compile etmemis olmanizdan kaynaklanabiliyor olabilir. Ancak gordugum kadari ile LAN'daki sunucularda monitoring yapmak istiyorsunuz. bu durumda SSL kullanmaniz sart degil. Bu nedenle /usr/local/nagios/libexec/check_nrpe -n -H 10.0.10.198 komutundaki gibi -n switchi ile SSL kullanmadan baglanti saglayabiliyor olmaniz gerekir. Kolay gelsin. Cagri Ersen.