Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Installing Nagios on openSUSE 11.0

Rumi, April 27, 2009

Scope:

Nagios is an excellent tool that can be used to monitor your systems and devices. For more detailed information check out the main Nagios site : Nagios.org

The scope of this howto is to give specific installation tips for Nagios running on openSUSE 11.x (should also work on openSUSE 10.3 and 11.1). Another aim is to give you an easy way to get graph history setup and more.

~

Step 1) Setting up openSUSE 11.0

Basically stick to the install defaults. I’d recommend to use the install DVD so you have all the needed packages at hand. Get that here : software.opensuse.org

Install your basic openSUSE system

Pointers on installing openSUSE 11.0 as base for Nagios *here*.

Note on 64bit: Although I have a couple of running 64bit Nagios systems, I can’t say for sure 64bit is fully functional (possible 3de party plugin issues). Nagios does support 64bit and the directory locations are the same as on 32bit.

2) Installing Nagios and needed packages

Download the jumpstart kit here : http://www.diwi.nl/downloads/jumstartkit.zip
It contains edited sample configurations and packages that adds to the standard setup. It also includes some more detail on what can be configured (Novell Netware users: config also included 😉 ).

* UPDATE : Thanks to the feedback I’ve received from Jan van de Voort, it’s come to my attention the the check_nrpe definition was missing from the included commands.cfg file.
Here is the correct version: http://www.diwi.nl/downloads/updated-commands.cfg.zip

Using YaST Nagios can be selected and installed. Seeing we want to get the most out of Nagios there are also some extra packages to install. We could use YaST to do this… Zypper on the other hand is quite powerful & I will be using it to install.

Let’s get installing:

Log in as the system user and open a terminal console and enter:

su -
<– elevates to root

* now we run the first install batch installs basic development packages

zypper install kernel-source make gcc gcc-c++

* the second batch installs nagios along with some goodies

zypper install nagios nagios-plugins nagios-plugins-extras nagios-nrpe rrdtool php5 php5-gd php5-zlib apache2-mod_php5 perl-SNMP net-snmp-32bit nmap ncpfs libwavpack1

NOTE: if you are using openSUSE 11.1 as base, the nagios-www package sometimes won’t get installed as dependancy. Make sure it gets installed or just add ‘ nagios-www’ to the install command.

* net-snmp-32bit is the package name if installing on a 64bit system. If your OS is 32bit change the package name to net-snmp.

Now set Nagios’s WWW password. This is the account you use to log into the monitoring page.

htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin

Your basic Nagios setup has been installed, now lets add some items:

3) Updating Nagios to 3.0.3 (or later)
NOTE: openSUSE 11.1 already includes 3.0.5, update to a later package if needed.

We can update Nagios to the latest release (v3.0.3 at the time of this writing) using rpms found at http://software.opensuse.org/search

From the extracted jumpstartkit copy the relevant files to new folder (e.g. we create a folder in /tmp called nagios303)

To update cd to /tmp/nagios303 and run:

rpm -Uhv *.rpm

While updating keep an eye out for error messages. The upgrade should go without to much hassle.

4) PNP addon:

PNP is an extension for Nagios that, along with the Rrdtool , makes for nice graphs and historic logging.
To install it download and extract the startkit zip.
Note: A newer version could be available from the OBS service

cd to the unzipped folder containing the PNP rpm and install it using:

rpm -Uhv pnp4nagios-.i586.rpm
<- 32bit OS
* or *
rpm -Uhv pnp4nagios-.x86_64.rpm <- 64 bit OS

5) Placing the modified config files

Now all the packages are installed we can copy over the basic configuration files found in the jumpstartkit.
Copy the files in the folder ‘/basic setup’ to the relevant locations (overwriting existing files).

When the copy is done check the placed configuration files for possible errors:

/usr/sbin/nagios -v /etc/nagios/nagios.cfg

No errors should be returned!

6) Setting the needed services to start at boot

To set the needed services to start at boot:

chkconfig apache2 on
chkconfig nagios on
chkconfig npcd on <- * only needed if running pnp in bulk mode

And now start them manually:

service apache2 start
service nagios start
service npcd start <- * only needed if running pnp in bulk mode

* PNP will be set to run in single mode to collect it’s data.
You can use the npcd daemon to run this action in bulk mode.
To enter this mode edit the nagios.cfg file as needed.

** Congratulations! Your customized Nagios is now running!! **

Nagios can be accessed by browsing to http://[ip or name server]/nagios

Log in with nagiosadmin and the password you have set for it.

You can now further customize and add the needed definitions within the /etc/nagios/objects directories.
Copy and rename the sample files so the end in the .cfg extension.

When nagios is restarted the *.cfg files will be read and changes should be reflected in the Nagios web interface.

tip: When you have configured Nagios to suit your needs, it’s a good idea to set the default runlevel to 3. This will let your system run using less memory. To set this edit /etc/inittab and set the initdefault from 5 to 3.

7) Enable mail support using postfix

Run YaST > ‘Mail Transfer Agent ‘
Choose standard setup, permanent connection and enter the outgoing server.
* If Nagios is set to mail to external addresses the outgoing server should be set to allow Nagios to relay mail.

Don’t forget to edit /etc/nagios/objects/contacts.cfg to reflect the correct contact email addresses.

8) Troubleshooting

Keep an eye on /var/log/messages. Nagios will write debug info to this log.

After making changes to configuration files always check for errors using the nagios verify option:

/usr/sbin/nagios -v /etc/nagios/nagios.cfg

—————————————————————-

Other useful information:

Nagios directories in openSUSE:

Configuration file locations:
/etc/apache2
/etc/nagios <– holds your Nagios configuration
/etc/nagios/pnp
/etc/nagios/objects <– holds Nagios templates, commands & definitions

Website & related files:
/usr/share/nagios
/usr/share/pnp

Logging and spooling directories:
/var/spool/nagios /pnp
/var/lib/nagios /pnp
/var/log/messages

Finding out more about a plugin
Most plugins have an extensive help page included that can be listed by running the plugin manually with the –help switch appended to it.

The plugins can be found in /usr/lib/nagios/plugins
cd into this directory and run the pluigin using the switch, e.g.

./check_load --help

Plugins needing special privileges
(as found at http://en.opensuse.org/Nagios-plugins)

There are at least three check scripts that need root privileges to run:

* check_dhcp
* check_icmp
* check_ide_smart

To be “safe per default”, SuSE doesn’t install these plugins with the suid bit set. There are two recommended ways about overriding this on your system:
[edit]
Set the suid bit

Note: Please choose only those examples you need.

* change the group ownership to the users primary group that executes this check (normally nagios):

chgrp nagios /usr/lib/nagios/plugins/check_dhcp
chgrp nagios /usr/lib/nagios/plugins/check_icmp
chgrp nagios /usr/lib/nagios/plugins/check_ide_smart

* set the suid bit so the plugin is executed as root:

chmod 4750 /usr/lib/nagios/plugins/check_dhcp
chmod 4750 /usr/lib/nagios/plugins/check_icmp
chmod 4750 /usr/lib/nagios/plugins/check_ide_smart

More information about Nagios on openSUSE:

http://en.opensuse.org/Nagios
http://en.opensuse.org/PNP4Nagios

—-

Need SMS notification support?
Check out http://www.mollie.nl or http://www.twisted-solutions.nl

—

Viewing the 3D status map:

To view this map you will need to install a VRML plugin.
For openSUSE freeWRL is a good choice.

Note: You will first need to install packages sox & openmotif before installing the freewrl package.

Administrations Configurations (Linux)

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes