Erinevus lehekülje "Nagios" redaktsioonide vahel
(→Install) |
(→Konfime nagiose) |
||
45. rida: | 45. rida: | ||
define host{ | define host{ | ||
− | use linux-server | + | name linux-server |
− | host_name | + | use generic-host |
+ | check_period 24x7 | ||
+ | max_check_attempts 10 | ||
+ | check_command check-host-alive | ||
+ | notification_period workhours | ||
+ | notification_interval 120 | ||
+ | notification_options d,u,r | ||
+ | contact_groups admins | ||
+ | register 0 | ||
+ | } | ||
+ | |||
+ | define host{ | ||
+ | use linux-server | ||
+ | host_name isp | ||
alias ISP Ruuter | alias ISP Ruuter | ||
− | address 192.168.1. | + | address 192.168.1.10 |
parents localhost | parents localhost | ||
+ | contact_groups Helpdesk | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Nüüd defineerime kontrollid mida tehakse antud serveritele. | Nüüd defineerime kontrollid mida tehakse antud serveritele. |
Redaktsioon: 29. jaanuar 2008, kell 00:39
Sissejuhatus
Nagios on vabavaraline arvutite, teenuste ja võrgu monitoorimise programm.
Install
FreeBSD
cd /usr/ports/net-mgmt/nagios && make install clean cd /usr/ports/net-mgmt/nagios-plugins && make install clean
Gentoo
emerge nagios emerge nagios-plugins
Debian
apt-get install nagios ?
...
Konfime nagiose
Näide
Oletame ,et meil on kolm masinat mida vaja jälgida. Ruuter, veebiserver ja mailiserver. Me soovime ,et kõiki neid kolme nagios pingiks iga viie minuti tagant ning kui üks masin juhtub maas olema siis teavitame sellest mailiaadressile helpdesk@domeen.ee
ip aadressidega
ruuter 192.168.1.1
veebiserver 192.168.1.2
mailiserver 192.168.1.3
Eesimesena on vaja defineerida hosts.cfg failis kõik kolm masinat
hosts.cfg
define host{ name linux-server use generic-host check_period 24x7 max_check_attempts 10 check_command check-host-alive notification_period workhours notification_interval 120 notification_options d,u,r contact_groups admins register 0 } define host{ use linux-server host_name isp alias ISP Ruuter address 192.168.1.10 parents localhost contact_groups Helpdesk }
Nüüd defineerime kontrollid mida tehakse antud serveritele. Tekitame service kirje mis pingib kõiki kolme masinat. Ruuterit, veebiserverit ja mailiserverit ning teavitab probleemide korral kontaktgruppi helpdesk
services.cfg
define service{ use local-service ; Name of service template to use host_name isp, www.tartu.ee, mail.tartu.ee service_description PING check_command check_ping!100.0,20%!500.0,60% contact_groups Helpdesk }
Lõpuks tekitame kolmanda faili kus kirjas kontaktid keda teavitatakse mõne seadme maasolekul.
Loome kontakti helpdesk mailiga helpdesk@domeen.ee ning lisame selle kontaktgruppi Helpdesk
contacts.cfg
define contact{ contact_name helpdesk alias IT Helpdesk service_notification_period 24x7 host_notification_period 24x7 service_notification_options u,c,r host_notification_options d,r service_notification_commands notify-by-email host_notification_commands host-notify-by-email email helpdesk@domeen.ee }
define contactgroup{ contactgroup_name Helpdesk alias IT Helpdesk members helpdesk }
Apache seadistus
<Directory /usr/local/www/nagios> Order deny,allow Deny from all Allow from 127.0.0.1 </Directory>
<Directory /usr/local/www/nagios/cgi-bin> Options ExecCGI </Directory>
ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/ Alias /nagios/ /usr/local/www/nagios/
Selline virtualhost toimib küll vaid bsd peal. Erinevates distrotes on rajad failideni teised. Üldiselt peale installi öeldakse kus kaustas nagios'i cgi veebiliides asub.
Konfime graafikud
Kasutame Nagios Grapherit tööks. Koduleht http://www.nagiosexchange.org/NagiosGrapher.84.0.html
Esimesena tõmbame selle alla.
http://www.nagiosexchange.org/42;195
tar -xf NagiosGrapher-1.6.1-rc2.tar.bz2 cd NagiosGrapher-1.6.1-rc2
lisame faili config.layout read
# default FreeBSD <Layout freebsd> prefix: /usr/local/nagios nagios_config: /usr/local/etc/nagios.cfg nagios_config_cgi: /usr/local/etc/cgi.cfg nagios_images: /usr/local/www/nagios/images nagios_images_logos: /usr/local/www/nagios/images/logos nagios_folder_cgi: /usr/local/www/nagios/cgi-bin perl_inc: /usr/local/lib/perl5/5.8.8/ nagios_contribution: /usr/local/nagios_grapher/contrib ng_config: /usr/local/etc/nagios_ng ng_config_sub: /usr/local/etc/nagios_ng/ngraph.d ng_daemon: /usr/local/nagios_grapher ng_srvext_file: /usr/local/etc/nagios_ng/serviceextinfo.cfg ng_srvext_dir: /usr/local/etc/nagios_ng/serviceext ng_interface_pipe: /var/spool/nagios/rw/ngraph.pipe ng_logfile: /var/log/ngraph.log ng_rrd: /var/spool/nagios/rrd </Layout>
ja kirjutame
autoconf ./configure --with-layout=freebsd make testdeps
arvatavasti teatatakse puuduvast tarkusest niisiis kirjutame
make fixdeps make install
ImageMagick ei installita vaid ainult cpanel asjad make fixdeps'iga nii peame
cd /usr/ports/graphics/ImageMagick make install clean
ja rrdtool graafikuteks
cd /usr/ports/net/rrdtool make install clean