Firefox 16, a treat for developers http://t.co/cnd27CzT
How to install and configure Nagios in FreeBSD
Nagios is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users
when things go wrong and again when they get better.
Nagios was originally designed to run under Linux, but also runs well on other Unix variants. It is free software, licensed under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
In this tutorial will show you how to install Nagios in freeBSD (Tested on FreeBSD 8.1 and 8.2).
We will start by installing AMP and then we will install Nagios.
1- Install Mysql Server 5.5 from ports
cd /usr/ports/databases/mysql55-servermake install clean
2- Enable and launch the mysql service
echo 'mysql_enable="YES"' >> /etc/rc.conf
3- Start mysql server
/usr/local/etc/rc.d/mysql-server start
4- Make mysql admin password
mysqladmin -u root password "newpassword"
5-Install Apache from ports
cd /usr/ports/www/apache22 make install clean
Enable mysql-support in the blue screen
6-Enable and launch the apache service
echo 'apache22_enable="YES"' >> /etc/rc.conf
Start Apache:
/usr/local/etc/rc.d/apache22 start
test ths apache page http://ip or http://hostname
7-Install PHP and php-extention
cd /usr/ports/lang/php52
make install clean
Make sure to enable apache module in the install Step (Blue screen) and
cd /usr/ports/lang/php52-extensions
make install clean
In this installation screen select sessions and mysql support
8-After this Activate the php configuration with
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
9-configure apache to read the PHP files
edit /usr/local/etc/apache22/httpd.conf and add
DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
10-Restart apache to check if you have any errors
# /usr/local/etc/rc.d/apache22 restart
Output:
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 61539.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
11-Check phpinfo page
Document root starndart in apache is /usr/local/www/apache22/data
Add the code to the file test.hpecho “<? phpinfo(); ?>” >> /usr/local/www/apache22/data/test.php
Now check the page http://ip/test.php
12-Install Nagios:
cd /usr/ports/net-mgmt/nagios
make install clean
And accept default installation, in installation screen of nagios plugins dont forget to add NETSNMP to nagios group and user.
13-Enable nagios to start with boot
echo 'nagios_enable="YES"' >> /etc/rc.conf
Now copy the sample page to the config files
cd /usr/local/etc/nagios/
cp cgi.cfg-sample cgi.cfg
cp nagios.cfg-sample nagios.cfg
cp resource.cfg-sample resource.cfg
Navigate to the /usr/local/etc/nagios/objects/ and do the same :
cp commands.cfg-sample commands.cfg
cp contacts.cfg-sample contacts.cfg
cp localhost.cfg-sample localhost.cfg
cp printer.cfg-sample printer.cfg
cp switch.cfg-sample switch.cfg
cp templates.cfg-sample templates.cfg
cp timeperiods.cfg-sample timeperiods.cfg
14-Now check you nagios configurations errors
# nagios -v /usr/local/etc/nagios/nagios.cfg
15-Make admin password for nagios home page (admin is nagiosadmin)
htpasswd -c /usr/local/etc/nagios/htpasswd.users nagiosadmin
16-Now add Nagios to your apache configuration:
edit /usr/local/etc/apache22/httpd.conf and at the end of the file add:
ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios /usr/local/www/nagios/
<Directory /usr/local/www/nagios>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName “Nagios Access”
AuthType Basic
AuthUSerFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>
<Directory /usr/local/www/nagios/cgi-bin>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName “Nagios Access”
AuthType Basic
AuthUSerFile /usr/local/etc/nagios/htpasswd.users
Require valid-user
</Directory>
save the config and exit
17-Restart apache to check if any errors
/usr/local/etc/rc.d/apache22 restart
Now open your nagios page with Http://ip/nagios and insert your login and password created before

-
-
-
http://heartofthesystem.blogspot.com
-
-
-
-
-
http://googleees.tk
-
-
http://googleees.tk
-
-
-
-
http://www.appfail.com
-
-
-
Like us on Facebook
This week Top Posts 
Top Things to do After Installing Ubuntu 13.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comment(s) |
Scan Your Home Network With Nmap : Who should read this article? Everyone who is interested in computer security and computer networkin...0 comment(s) |
How to use Remote Desktop in Ubuntu : Sometimes, we need to access our computer from other locations when we’re not at home and such. This...0 comment(s) |
Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
Recent Posts
- Secure File from Removal in Linux and Unix
- How to Install Nginx on FreeBSD 9.x
- Create a Launcher in Ubuntu Using Bash
- Scan Your Home Network With Nmap
- Steganography- Hide Your Files Inside An Image in Linux
- Unix/Linux File Recognition. Did You Know?
- Migrate from MySQL to MariaDB in FreeBSD
- Connect Your Android Galaxy Tablet to Ubuntu via USB
- ElementaryOS Beta 1 and 2 Comparison and Review
- Introduction to the Linux Command Line
Recent Comments

























Snake
| #
Wow, great. That’s what i’m waiting for too. I want to make DC with LDAP ( Active Directory alternative) and SAMBA on Ubuntu. :-)
Blawer
| #
Thanks!!!!!!!!!!!!!!!!!! you rules!!! all the other “help” in google are useless… yours was very helpful. Thanks again
piCool
| #
Great ! we have another another master trick :-)
Yilmaz Ulugtekin
| #
Just delete the space after the slash (/) it will work.
Pat L
| #
I tried it and it works with a regular zip file, but if you password-protect the .zip file it does NOT work.