<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt Gibson &#187; administration interface</title>
	<atom:link href="http://www.mattgibson.ca/tags/administration-interface/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattgibson.ca</link>
	<description>I'm one of those people radio shows call for obscure shit.</description>
	<lastBuildDate>Thu, 25 Mar 2010 00:04:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Monitoring Asterisk with SNMP, Nagios and Nagios Administrator using Ubuntu LTS 8.0.4 Server</title>
		<link>http://www.mattgibson.ca/2008/06/19/monitoring-asterisk-with-snmp-nagios-and-nagios-administrator-using-ubuntu-lts-804-server/</link>
		<comments>http://www.mattgibson.ca/2008/06/19/monitoring-asterisk-with-snmp-nagios-and-nagios-administrator-using-ubuntu-lts-804-server/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 09:24:17 +0000</pubDate>
		<dc:creator>Matt G</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[administration interface]]></category>
		<category><![CDATA[LTS]]></category>
		<category><![CDATA[monitoring tool]]></category>
		<category><![CDATA[nagios installation]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[server edition]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.mattgibson.ca/archives/114</guid>
		<description><![CDATA[Gone are the days of tedious console only configuration of Nagios. While it&#8217;s an excellent system monitoring tool, it can be a little daunting to configure and setup. Not to mention editing 5 or 6 configuration files when adding one host. In April 2008, Nagios Administrator was released, which promises to deliver an easy to [...]]]></description>
			<content:encoded><![CDATA[<p>Gone are the days of tedious console only configuration of <a href="http://www.nagios.org/">Nagios</a>. While it&#8217;s an excellent <a href="http://www.nagios.org/">system monitoring tool</a>, it can be a little daunting to configure and setup. Not to mention editing 5 or 6 configuration files when adding one host.</p>
<p>In April 2008, <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> was released, which promises to deliver an easy to use administration interface for configuring your Nagios installation with ease. The interface allows for adding contacts, contact groups, services, operating systems, and other settings. The one thing we noticed that was missing was service groups, but we&#8217;re not sure that really matters.</p>
<p>Using this article in conjunction with our previous <a title="Monitoring Asterisk with SNMP" href="http://www.voipphreak.ca/2007/04/16/monitoring-asterisk-14-with-snmp-and-cacti-for-pretty-graphs/">Monitoring Asterisk with SNMP</a> article will yeild you great results and awesome statistics.</p>
<p>Since there is already a demo running of the <a href="http://www.nagiosadmin.de/">Nagios Administrator</a>, I don&#8217;t think I need to show you screenshots, instead here is a link from their site.</p>
<blockquote><p>NagiosAdministrator: <a href="http://demo.nagiosadmin.de">http://demo.nagiosadmin.de</a><br />
Nagios: <a href="http://demo.nagiosadmin.de/nagios">http://demo.nagiosadmin.de/nagios</a></p>
<p>Username: nagiosadmin<br />
Password: nagiosadmin</p></blockquote>
<p>We installed this on a <a href="http://www.vmware.com/">VMWare Appliance</a>, running <a href="http://www.ubuntu.com/">Ubuntu</a> <a href="http://www.ubuntu.com/getubuntu/download">Server Edition LTS 8.04</a>, so you may have to change the instructions to suit your particular flavour of <a href="http://www.linux.org/">Linux</a>. Or <a href="http://www.microsoft.com/">Microsoft Windows</a> if you&#8217;re brave enough to try this on that OS.</p>
<p>Anyhow, now on to the tutorial on getting <a href="http://www.nagios.org/">Nagios 3.0</a> running with <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> on your <a href="http://www.ubuntu.com/">Ubuntu</a> <a href="http://www.ubuntu.com/getubuntu/download">Server</a>.</p>
<p>First, with the help of <a href="http://www.michel-sigloch.de/">Michel Sigloch</a>, we have this from a script of his that we&#8217;ve edited. This will install <a href="http://www.nagios.org/">Nagios</a> 3.0 from source on your ubuntu server, since the apt tree still holds an older version.</p>
<p><strong>Installing Nagios</strong></p>
<p>Start with the preliminaries:</p>
<blockquote><p># sudo apt-get install apache2 build-essential wget perl libgd2-xpm-dev openssl libssl-dev openssh-server openssh-client ntpdate snmp smbclient libldap-2.3-0 libldap2-dev mysql-server libmysqlclient15-dev qstat libnet-snmp-perl mrtg nut unzip<br />
# sudo userdel -f nagios<br />
# sudo useradd -c &#8220;Nagios Admin&#8221; nagios<br />
# sudo groupadd nagcmd<br />
# sudo usermod -G nagcmd nagios<br />
# sudo usermod -G nagcmd www-data<br />
# sudo usermod -a -G nagios www-data</p></blockquote>
<p>Then We&#8217;ll setup the <a href="http://www.nagios.org/">Nagios</a> directories and configure Nagios.</p>
<blockquote><p># sudo mkdir /usr/local/src<br />
# cd /usr/local/src<br />
# sudo wget <a href="http://nagios.sourceforge.net/download/cvs/nagios-cvs.tar.gz">http://nagios.sourceforge.net/download/cvs/nagios-cvs.tar.gz</a><br />
# sudo tar xvzf nagios-cvs.tar.gz<br />
# sudo rm nagios-cvs.tar.gz<br />
# cd nagios-cvs<br />
# sudo ./configure &#8211;with-command-group=nagcmd</p></blockquote>
<p>Now lets install <a href="http://www.nagios.org/">Nagios</a> and update the default boot programs, while restarting apache and <a href="http://www.nagios.org/">Nagios</a></p>
<blockquote><p># sudo make all<br />
# sudo make install<br />
# sudo make install-init<br />
# sudo make install-commandmode<br />
# sudo make install-config<br />
# sudo ln -sf /usr/local/nagios/etc/ /etc/nagios<br />
# sudo make install-webconf</p></blockquote>
<p>Next we&#8217;ll setup our htaccess file:</p>
<blockquote><p># sudo htpasswd -c /etc/nagios/htpasswd.users nagiosadmin<br />
# sudo chown www-data htpasswd.users<br />
# sudo chmod 600 htpasswd.users</p></blockquote>
<p>Download and configure nagios plugins. The plugins are what let you monitor things like your <a href="http://www.asterisk.org/">Asterisk PBX</a> using <a title="Monitoring Asterisk with SNMP" href="http://www.voipphreak.ca/2007/04/16/monitoring-asterisk-14-with-snmp-and-cacti-for-pretty-graphs/">SNMP</a> or other methods.</p>
<blockquote><p># cd /usr/local/src<br />
# sudo wget <a href="http://heanet.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz">http://heanet.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz</a><br />
# sudo tar xvzf nagios-plugins-1.4.11.tar.gz<br />
# cd nagios-plugins-1.4.11<br />
# sudo ./configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios<br />
# sudo make<br />
# sudo make install</p></blockquote>
<p>Now we are pretty much done with <a href="http://www.nagios.org/">Nagios</a> setup. We can move on to setting up <a href="http://www.nagiosadmin.de/">Nagios Administrator</a>. This part of the process can be a little confusing since their <a href="http://www.nagiosadmin.de/wiki/Installation_Nagiosadmin_auf_Debian">documentation is in german</a>. I taught myself a bit of german last night reading this, but I decyphered it for us to use it. Keep reading for the <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> Setup portion.</p>
<p><strong>Configuring and installing Nagios Administrator</strong></p>
<p>First, we&#8217;ll have to install any pre-requisite packages for <a href="http://www.nagiosadmin.de/">Nagios Administrator</a>:</p>
<blockquote><p># sudo apt-get install php5-common traceroute php5-cli php5-gd</p></blockquote>
<p>Now lets create our web directory</p>
<blockquote><p># sudo mkdir /var/www/nagiosadmin</p></blockquote>
<p>Now we can download our <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> files and drop them into the web directory on our server.</p>
<blockquote><p># cd /usr/src<br />
# sudo wget <a href="http://www.nagiosadmin.de/nagiosadmin-0.9.1.tar.bz2">http://www.nagiosadmin.de/nagiosadmin-0.9.1.tar.bz2</a><br />
# sudo tar xjpf nagiosadmin-0.9.1.tar.bz2 -C /var/www/nagiosadmin/</p></blockquote>
<p>Now we&#8217;ll create the mysql database. Like this</p>
<blockquote><p># mysqladmin -u root -p create nagiosadmin<br />
# mysql -u root -p</p>
<p>mysql&gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,ALTER,INDEX,DROP<br />
ON nagiosadmin.*<br />
TO <a href="mailto:'nagiosadmin'@'localhost'">&#8216;nagiosadmin&#8217;@'localhost&#8217;</a><br />
IDENTIFIED BY &#8216;somepassword&#8217;;</p></blockquote>
<p>Now we have to configure <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> to connect to our Database.</p>
<blockquote><p># cd /var/www/nagiosadmin<br />
# nano config/propel.ini</p></blockquote>
<p>and set</p>
<blockquote><p>propel.database.url        = mysql://nagiosadmin:yourpassword@localhost/nagiosadmin</p></blockquote>
<p>Now we edit the databases file and enter our database settings</p>
<blockquote><p># sudo nano config/databases.yml</p></blockquote>
<p>and set</p>
<blockquote><p>database:           nagiosadmin<br />
username:           nagiosadmin<br />
password:           yourpassword</p></blockquote>
<p>Now we have to make sure our Nagios shell commands are set properly in <a href="http://www.nagiosadmin.de/">Nagios Administrator</a>.</p>
<blockquote><p># sudo nano apps/backend/modules/generator/config/module.yml</p></blockquote>
<p>and make sure your paths are correct for these two lines</p>
<blockquote><p>config_check_command:           /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg 2&gt;&amp;1<br />
reload_nagios_command:          /usr/bin/sudo /usr/bin/killall -HUP nagios</p></blockquote>
<p>Now we have to enter visudo to set up the permissions for our <a href="http://www.nagios.org/">Nagios</a> user, done like this:</p>
<blockquote><p># sudo visudo</p></blockquote>
<p>then add</p>
<blockquote><p># for nagios<br />
%nagcmd ALL= NOPASSWD: /usr/bin/killall -HUP nagios</p></blockquote>
<p>Exit visudo by hitting the ESC key, and then typing &#8220;:wq&#8221; hitting enter.</p>
<p>Now, We have to do a few things that are pretty self explanitory with the <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> control file.</p>
<blockquote><p># cd /var/www/nagiosadmin<br />
# sudo ./symfony fix-perms<br />
# sudo ./symfony propel-insert-sql<br />
# sudo ./symfony propel-load-data backend<br />
# sudo ./symfony check</p></blockquote>
<p>Next we&#8217;ll have to insert our Apache virtual host.</p>
<blockquote><p># sudo nano /etc/apache2/conf.d/nagios.conf</p></blockquote>
<p>Make sure you enter this line, and change the path to match your install if you changed the above instructions</p>
<blockquote><p>Alias /nagios/images/logos/nagiosimages /var/www/nagiosadmin/web/uploads/os_images</p></blockquote>
<p>Also, in the default settings, make sure to change all of the references to the htpasswd file to the following</p>
<blockquote><p>AuthUserFile /etc/nagios/htpasswd.users</p></blockquote>
<p>Now, lets setup the new virtual host for our <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> and <a href="http://www.nagios.org/">Nagios</a> site.</p>
<blockquote><p># sudo mv /etc/apache2/sites-enabled/000-default ~/000-default.backup<br />
# sudo rm /etc/apache2/sites-enabled/000-default</p></blockquote>
<p>Now we have to add our new default virtual host configuration like so</p>
<blockquote><p># sudo touch /etc/apache2/sites-enabled/nagios.conf</p></blockquote>
<p>Enter the following, changing any paths as according to your configuration if you deviated from above.</p>
<blockquote><p>&lt;VirtualHost *:80&gt;</p>
<p>ServerAdmin <a href="mailto:root@yourdomain.com">root@yourdomain.com</a><br />
ServerName monitor.yourdomain.com<br />
DocumentRoot &#8220;/var/www/nagiosadmin/web&#8221;<br />
php_admin_flag magic_quotes_gpc 0<br />
php_admin_value memory_limit &#8220;32M&#8221;</p>
<p>&lt;Directory &#8220;/var/www/nagiosadmin/web&#8221;&gt;<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</p>
<p>&lt;Files index.php&gt;<br />
AuthType Basic<br />
AuthName &#8220;NagiosAdmin&#8221;<br />
AuthUserFile /etc/nagios/htpasswd.users<br />
require user nagiosadmin<br />
&lt;/Files&gt;</p>
<p>Alias /phpmyadmin /var/www/phpmyadmin<br />
&lt;Directory /var/www/phpmyadmin&gt;<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;</p></blockquote>
<p>Now we have to enable mod rewrite like this</p>
<blockquote><p># sudo mod_rewrite aktivieren</p></blockquote>
<p>And next lets restart Apache</p>
<blockquote><p># sudo /etc/init.d/apache2 restart</p></blockquote>
<p><strong>Configuring Nagios 3.0 to work with Nagios Administrator</strong></p>
<p>Now we have to make some quick edits to the nagios configuration and we&#8217;ll be up and running in no time.</p>
<p>First lets edit the Nagios configuration file</p>
<blockquote><p># nano /etc/nagios/nagios.cfg</p></blockquote>
<p>Now make sure yours looks like the following, commenting out the ones that are on by default and adding the new <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> directory at the bottom.</p>
<blockquote><p>#cfg_file=/usr/local/nagios/etc/objects/commands.cfg<br />
#cfg_file=/usr/local/nagios/etc/objects/contacts.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg<br />
#cfg_file=/usr/local/nagios/etc/objects/templates.cfg</p>
<p># Definitions for monitoring the local (Linux) host<br />
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg</p>
<p>#cfg_dir=/usr/local/nagios/etc/servers<br />
#cfg_dir=/usr/local/nagios/etc/printers<br />
#cfg_dir=/usr/local/nagios/etc/switches<br />
#cfg_dir=/usr/local/nagios/etc/routers<br />
cfg_dir=/var/www/nagiosadmin/data/nagios</p></blockquote>
<p>Now, before starting nagios for the first time, lets go into the configuration interface and set up some default values.</p>
<p>Open a web browser and hit this url:</p>
<blockquote><p><a href="http://monitor.yourdomain.com/">http://monitor.yourdomain.com/</a></p></blockquote>
<p>You should see the login box for your <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> site, which you can login with &#8220;nagiosadmin&#8221; and the password you entered earlier.</p>
<p>Once you login to the site, you will have to configure the following things:</p>
<blockquote><p>contacts -&gt; create -&gt; make one or two contacts<br />
contact groups -&gt; create -&gt; create a contact group, and assign some contacts to it<br />
host groups -&gt; create -&gt; create a host group<br />
host -&gt; create -&gt; create some hosts</p></blockquote>
<p>Now, go to the &#8220;Generator&#8221; Menu, and click on &#8220;Save&#8221;.</p>
<p>Now, go back to your command prompt, and start Nagios. It should start with no errors.</p>
<blockquote><p># sudo /etc/init.d/nagios start</p></blockquote>
<p>Now, go back to the web interface, you should be able to save and generate your configuration file with no errors.</p>
<p>Finally, add Nagios to your default runlevel</p>
<blockquote><p># sudo update-rc.d nagios defaults</p></blockquote>
<p><strong>Congratulations, we&#8217;re finished!<br />
</strong><br />
We are now finished with the setup. It&#8217;s up to you to setup proper security measures for the <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> and <a href="http://www.nagios.org/">Nagios</a> site.</p>
<p>You can visit the <a href="http://www.nagiosadmin.de/">Nagios Administrator</a> panel here:</p>
<blockquote><p><a href="http://monitor.yourdomain.com/">http://monitor.yourdomain.com/</a></p></blockquote>
<p>and you can visit <a href="http://www.nagios.org/">Nagios</a> here</p>
<blockquote><p><a href="http://monitor.yourdomain.com/nagios/">http://monitor.yourdomain.com/nagios/</a></p></blockquote>
<p>Remember, you can also take a look at our <a title="Monitoring Asterisk with SNMP" href="http://www.voipphreak.ca/2007/04/16/monitoring-asterisk-14-with-snmp-and-cacti-for-pretty-graphs/">Monitoring Asterisk with SNMP Howto</a> for information on getting even more statistics from your <a href="http://www.asterisk.org/">Asterisk PBX</a> than you ever thought possible. We hope you like this article, and welcome comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattgibson.ca/2008/06/19/monitoring-asterisk-with-snmp-nagios-and-nagios-administrator-using-ubuntu-lts-804-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
