Easy step to configure basic Nagios on SLES 11:

.
1. Install service:
Using “yast -i” command to install all of these packages: nagios, gd [don’t forget to verify apache2 & gcc]

2. Create username & password for access nagios through web browser:
#htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin
Then enter password…
3. Start/Restart services: 
#rcnagios start; rcapache2 start
4. Test from client, by the following: 
Enter usename & password “nagiosadmin”
5. Configure to monitor a few thing:
i. copy images/logo to “/usr/share/nagios/images/logos”
ii. copy files from template and edit them:
#cp windows.cfg windows7.cfg
define host{
use             windows-server  ; Inherit default values from a template
host_name       windows7        ; The name we’re giving to this host
alias           Windows7        ; A longer name associated with the host
address         192.168.96.1    ; IP address of the host
#
parents         switch1
icon_image      win7.jpg
vrml_image      win7.jpg
statusmap_image win7.jpg
}
*** change all to “host_name windows7”
To change all “localhost” to “suse”, use the following techniques in “vim”
Esc
:%s/localhost/suse
#cp switch.cfg switch1.cfg
define host{
use             generic-switch          ; Inherit default values from a template
host_name       switch1         ; The name we’re giving to this switch
alias           Linksys SRW224P Switch  ; A longer name associated with the switch
address         192.168.96.254          ; IP address of the switch
hostgroups      switches                ; Host groups this switch is associated with
 
icon_image switch1.jpg
vrml_image      switch1.jpg
statusmap_image switch1.jpg
}
*** and change all to “host_name switch1” ;swich1 or your preference
iii. edit to fit what you have modified in folder objects “vim /etc/nagios/nagios.cfg”
cfg_file=/etc/nagios/objects/localhost.cfg
cfg_file=/etc/nagios/objects/windows7.cfg
cfg_file=/etc/nagios/objects/switch1.cfg
*** you also can let it check all *.cfg in specific directory…
6. Reload services: 
#rcnagios reload;rcapache2 reload
7 Troubleshooting tips:
***any error, you will need to check: “less /var/log/nagios/config.err”
***prevent http warning while restart service, edit “vim /etc/hosts”
#127.0.0.1       localhost
192.168.96.2    sles.linux.lan  sles
7. To view map:
>Status Map
 
8. Email notification:
#vim /etc/nagios/objects/contact.cfg
 
…. 
email nagios@domain.local
 
***Note: to be able to monitor Windows clients, you need to install and configure NSClient++. It’s not difficult to install it, what important is the point which you need to specify your “Nagios server ip address” and below it, you will need to “tick” all options.
Enjoy Yours!!!
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s