As you know i have install nagios as my monitoring tools to me nagios was one of the finest availability and monitoring solutions available. The stability, extendability and cost effectiveness (it is free under the GPL). And it is far from being the easiest monitoring solution to implement. The build process itself, while not being overly complicated you must have to manualy set the nagios configuration to add a new host and etc that is why i was looking for projects that aim to ease both the installation and configuration of Nagios and my selection goes to Groundwork.
GroundWork Monitor is an open source IT monitoring solution that enables you to maintain network visibility and control. It’s extensible and can integrate with leading proprietary third-party tools, including help desk, configuration management databases (CMDBs), management consoles and monitoring tools. This is a single server deployment that leverages the strengths of 15 other open source projects such as Nagios, rrdtool and nmap. It combines the results of these projects in to a system that evaluates the status, events and performance of monitored devices and presents these results in an easy to understand web application. There were 3 version of groundwork :
The Community, Professional and Enterprise versions include monitoring for servers, devices, applications and performance, the Community product is designed to monitor less than 100 devices, while the Professional and Enterprise version can keep tabs on hundreds of devices and is commercially supported. We will use The Community Edition.
Cacti is a complete frontend to RRDTool, RRD stands for Round Robin Database, which is a system to store and display time-series data such as network bandwidth, machine-room temperature, and server load average. Cacti leverages the features of RRDtool and stores the data it collects in Round Robin archives. It stores all of the necessary information to create graphs and populate them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.
On this tutorial we will install GroundWork Monitor Community Edition on CentOS 5.2 and integrate it with cacti
1. Make sure you’ve installed the following packages on your CentOS installation before continuing.
2. I assume you have installed Apache and we will install Perl-DBI using RPM, you need to download it first
cd tmpwget ftp://archive.groundworkopensource.com/pub/pre-req-community-edition/perl-DBI-1.40-5.i386.rpm
After downloading, enter the following command to install :
rpm -ivh perl-DBI-1.40-5.i386.rpm
Now we installed the Java JDK Update 6:
wget ftp://archive.groundworkopensource.com/pub/pre-req-community-edition/jdk...
2. Un-tar package with the command:
tar xvfz jdk-1_5_0_06-linux-i586-rpm.bin.tar.gz
3. Change the permissions to execute:
chmod +x jdk-1_5_0_06-linux-i586-rpm.bin
4. Execute the binary file to extract/install the RPM file with the command:
./jdk-1_5_0_06-linux-i586-rpm.bin
You will be prompted to accept the license.
All files will be put into: /usr/java
Now we download the MySQL Community Edition on http://dev.mysql.com/downloads/mysql/5.0.html#linux-rhel5-x86-32bit-rpms
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-server-community-5.0....
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-shared-community-5.0....
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-devel-community-5.0.6...
wget ftp://mirror.switch.ch/pool/1/mirror/mysql/Downloads/MySQL-5.0/MySQL-client-community-5.0.51a-0.rhel5.i386.rpm
Before start the installation you need to set the host first on etc/hosts/
vi /etc/hosts
add this
127.0.0.1 localhost localhost.localdomain 192.168.1.117 Groundwork Groundwork.Server
you can changes 192.168.1..117 to be your own server ip address
1. Download the groundwork community for CentOS 5
wget http://superb-east.dl.sourceforge.net/sourceforge/gwmos/groundwork- ce-5.2.1-52.rhel5.i386.tar.gz
2. Uncompress the Groundwork CentOS 5 packet
tar -xzvf groundwork-ce-5.2.1-52.rhel5.i386.tar.gz
3. go to groundwork-installer-5.2.1/ folder and start the installation
./run_install.sh
you will get prompted with some question and ask about your mysql password
Ground work are installed now you can go to your server address Go to the URL: http://<hostaddress>/, you can login using user/password : admin/admin for your first login

you can see the nagios localhost stats in there


How to configure the ground work
Offcourse you wanted to add a new host and on groundwork you can easily do that, just go to configuration -> host wizard fill out this Host Vitals details and click next


then pick the parents for your new host on Host Properties 1 and click next, you cannot pick your own hostname as your parents you must pick another one or it will be error

and pick Hostgroups on Host Properties 2 pages

and you can add another services and after you finish you can save it as new profiles

okay you have create a new host beside the localhost now you just need to activate it and you can do it by picking control option on the top list and you can test it by click the Pre flight test then if there is no error you can click Commit to activate your settings

Now you can see the new host nagios monitor under localhost on monitoring server option click View Service Status Detail For All Hosts to see all host

Next time youw anted to add new host with the same services you can just clone the old host and add the new host ip address. Okay , now we will install Cacti and integrate it to our Groundwork
Before we installed cacti please makesure you have install snmp, you can install it by using yum.
yum install php-snmp net-snmp net-snmp-utils rrdtool
then don’t foget to start snmp
service snmp start
1. Download cacti, extract it and copy it to groundwork htdocs directory
cd /tmp wget wget http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz tar -zxvf cacti-0.8.7b.tar.gz mv cacti-0.8.7b cacti cp -R cacti /usr/local/groundwork/apache2/htdocs/
2. Create the MySQL database for Cacti
mysqladmin -u root -p create cacti
then enter the mysql root password to create it
Import the default cacti database to our mysql, you need to go to cacti folder first on /usr/local/groundwork/apache2/htdocs/cacti
cd /usr/local/groundwork/apache2/htdocs/cacti mysql -u root -p cacti < cacti.sql Enter password:
Optional: Create a MySQL username and password for Cacti. If you’ve added a mysql passwd, you’ll need to login with that.
mysql -u root -p
Enter password:
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql> flush privileges;
Edit Cacti Config in /usr/local/groundwork/apache2/htdocs/cacti/include/config.php and specify the MySQL user, password and database for your Cacti configuration.
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "somepassword";
Add the cacti poller to your /etc/crontab file
crontab -e
*/5 * * * * root /usr/local/groundwork/bin/php /usr/local/groundwork/apache2/htdocs/cacti/poller.php > /dev/null 2>&1
Add cacti directory to the /usr/local/groundwork/apache2/conf/httpd.conf file
vi /usr/local/groundwork/apache2/conf/httpd.conf <Directory "/usr/local/groundwork/apache2/htdocs/cacti"> AuthType Basic require valid-user TKTAuthLoginURL http://127.0.0.1/monitor/index.php TKTAuthCookieName cacti_auth_tkt TKTAuthTimeout 0 </Directory>
Then Restart Apache
Service httpd restart
Go to cacti admin site to start the installation http://<server>/cacti/install , you will found some component was not found warning
you need to modify it
/usr/local/groundwork/bin/snmpwalk /usr/local/groundwork/bin/snmpget /usr/local/groundwork/bin/snmpbulkwalk /usr/local/groundwork/bin/snmpgetnext /usr/local/groundwork/bin/rrdtool /usr/local/groundwork/bin/php
Now you can login to cacti with default username/password admin/admin and set the cacti config
go to Settings -> General Tab:
Select RRDTool Version: 1.2
and go to Settings -> Paths to verify the paths then Add fonts path:
go to Settings -> Authentication (since we are using SSO. If you don’t want SSO, leave this checked.)
Uncheck ‘UseCacti’s Builtin Auth’
Now since the cacti was installed we need to add cacti to groundwork using wrappit
go to General Tab and add this :
Name: Cacti
Desc: Cacti
Base URL: /cacti
Welcome:
go to SSO menu
go to Export
#Install Package
Now we need add view to admin
# Administration -> Roles -> Administrators
Cacti should be one of the options in the drop-down menu now.
Syed Sajjad | August 3rd, 2009 at 12:49 pm #
Thank you for this post. Now the question is how do I get Cacti display Groundwork generated graphs under groundwork/rrd folder? Polling a server twice doesn’t make sense to me.