Changes

From Amahi Wiki
Jump to: navigation, search
8,629 bytes added ,  05:06, 17 July 2011
no edit summary
message = This is recommended only for advanced users, proceed with caution.}}
'''NOTE: ''' Understand that without a web interface to do the configuration of objects the learning curve is large to configure Icinga for the first time.
 
These instructions were modified from documentation already on the [http://docs.icinga.org/1.4.0/en/ Icinga Website]. They are geared toward installing Icinga v1.4.
 
These instructions are the combined effort documented in the following Icinga Documentation pages:
* [http://docs.icinga.org/1.4.0/en/quickstart-icinga.html Icinga Quickstart]
* [http://docs.icinga.org/1.4.0/en/quickstart-idoutils.html Icinga with IDOUtils Quickstart]
* [http://docs.icinga.org/1.4.0/en/icinga-web-scratch.html Installation of the Icinga-Web Frontend]
* [http://docs.icinga.org/1.4.0/en/icinga-api.html Installation and use of the Icinga API]
 
If you have any questions then please contact me.
 
-- [[User:Sag47|Sag47]] 22:06, 16 July 2011 (PDT)
= What is Icinga? =
* Fedora 14
* Amahi set up and running
* and update your HDA Server and install all of the following packages installedprereqs for Icinga/Icinga-web{{Code|'''NOTE:''' If there is a kernel update then you should restart your machine after running yum groupinstall "Development Tools" "Legacy Software Development"}}update and start these instructions over.
== Installation =={{Code|Follow the [http://docsyum check-updateyum update -yyum groupinstall "Development Tools" "Legacy Software Development" -yyum install <nowiki>httpd httpd-devel gcc glibc glibc-common gd gd-devel libjpeg libjpeg-devel libpng libpng-devel mysql mysql-server libdbi libdbi-devel libdbi-drivers libdbi-dbd-mysql net-snmp net-snmp-devel net-snmp-utils php php-cli php-pear php-xmlrpc php-xsl php-pdo php-gd php-ldap php-mysql php-mysql php-soap java-1.icinga6.org/0-openjdk java-1.46.0-openjdk-devel zip unzip</en/quickstartnowiki> -icinga.html Quickstart Installation Guide for Icinga] to compile and install Icinga and common Nagios plugins.y}}
Once you have Icinga running when you attempt == Create a Webapp ==Go to access the web interface you should get permission deniedyour HDA CP (HDA Control Panel) and go to Apps > Webapps and click New Webapp. That Name it "icinga" without quotes.Root path should be /var/hda/web-apps/icinga (which is okay because we're going to fix that nowautomatically generated by Amahi).
Visit your Create /var/hda at http:/web-apps/icinga/html/hda because now you have to set up a webappindex. I know that this is in reverse order html and that give it should be compiled for the webapp directory but I'm still new to Amahi and not new to other things. So more detailed and correct instructions will come laterfollowing contents.{{Text|Text=<pre><nowiki><html><head><title>Icinga Monitoring Server</title><meta HTTP-EQUIV="REFRESH" content="0; url=/icinga/"></head><body></body></html></nowiki></pre>}}
Anyway, go '''NOTE:''' Icinga will install to /usr/local/icinga. Icinga Web will install to /usr/local/icinga-web == Download required source tarballs ==Download the following packages from the [http://hdasourceforge.net/projects/icinga/files/ Icinga Project Page].* icinga/icinga-1.4.2.tar.gz or latest 1.4.x* icinga-web/icinga-web-1.4.1.tar.gz or latest 1.4.x* icinga-mobile/icinga-mobile-0.1.0.zip or latestDownload the following packages from the [http://sourceforge.net/projects/nagiosplug/files/ Nagios Plugin Project Page].* nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz or latestDownload the [https://git.icinga.org/setupindex?subp=icinga-api.git;a=snapshot;h=webapps&tabrefs/heads/master;sf=app tgz latest Icinga API] from git snapshot as seen in the [http://docs.icinga.org/1.4.0/en/icinga-api.html Icinga API] documentation. Move all source tarballs to /usr/src/ on your HDA server. == Compile and install Icinga with IDOUtils ==Create an icinga user, icinga-cmd group, and add the apache user and icinga user to the icinga-cmd group.{{Code|useradd -m icingagroupadd icinga-cmdusermod -a -G icinga-cmd icingausermod -a -G icinga-cmd apache}} Now lets do some compiling.{{Code|cd /usr/src/tar -xzf icinga-1.4.2.tar.gzcd icinga-1.4.2./configure <nowiki>--with-command-group=icinga-cmd --enable-idoutils --enable-event-broker</nowiki>make allmake fullinstall}}Edit the ''/usr/local/icinga/etc/objects/contacts.cfg'' config file with your favorite editor and change the email address associated with the icingaadmin contact definition to the address you'd like to use for receiving alerts.{{Code|vim /usr/local/icinga/etc/objects/contacts.cfgcp /usr/local/icinga/etc/ido2db.cfg-sample /usr/local/icinga/etc/ido2db.cfgcp /usr/local/icinga/etc/idomod.cfg-sample /usr/local/icinga/etc/idomod.cfgcp /usr/local/icinga/etc/modules/idoutils.cfg-sample /usr/local/icinga/etc/modules/idoutils.cfg}} Create the icinga db/user/pass for IDOUtils to use and import the mysql database (you should still be in ''/usr/src/icinga-1.4.2'' working directory).{{Code|hda-create a new webapp -db-and call it -user icingamysql -u icinga -picinga icinga< module/idoutils/db/mysql/mysql.sql}} Configure the password for the icinga directory.{{Code|htpasswd -c /usr/local/icinga/etc/htpasswd.users icingaadmin}} Configure the Apache config located in ''/etc/httpd/conf.d/''
Now it's time to go into the terminal. All commands will be run as root and lines that start with # are comments.
{{Code|ls /etc/httpd/conf.d/ <nowiki>|</nowiki> grep icinga
#you should see two files. Something like 10071002-icinga.conf and icinga.confcat /etc/httpd/conf.d/icinga.conf >> /etc/httpd/conf.d/10071002-icinga.conf#Now edit /etc/httpd/conf.d/10071002-icinga.confvim /etc/httpd/conf.d/10071002-icinga.conf
#and move </VirtualHost> from the middle of the file to the end.
#be sure to confirm that the contents of icinga.conf are within 10071002-icinga.conf before removing itrm -f /etc/httpd/conf.d/icinga.conf}} Start icinga, idoutils and restart the apache server.{{Code|service icinga startservice ido2db startservice httpd restart}}Now you should have a 1007-Visit http://icingaand make sure that it is currently working.conf file similar  '''Note:''' http://icinga should redirect to http://icinga/icinga and your localhost (which is the following (not exactAmahi HDA)will show up as down. == Install Nagios Plugins ==Time to compile again!{{TextCode|Text=cd /usr/src/tar -xzf nagios-plugins-1.4.15.tar.gzcd nagios-plugins-1.4.15./configure <prenowiki>--prefix=/usr/local/icinga --with-cgiurl=/icinga/cgi-bin --with-htmurl=/icinga --with-nagios-user=icinga --with-nagios-group=icinga</nowiki><VirtualHost *makemake installservice icinga restart}}Now visit http:80>//icinga/ and click on Service Detail in the menu on the left under Status. After about 5 mins everything should slowly start turning green.
ServerName == Install the latest Icinga API ==Don't worry, there's nothing to compile here. But you still have to configure and install the Icinga API.{{Code|cd /usr/src/tar -xzf icinga-api-refs-heads-master.tar.gz ServerAlias cd icinga-api.home/configure <nowiki>--datarootdir=/usr/local/icinga/share --sysconfdir=/usr/local/icinga/etc --with-command-user=icinga-cmd --with-command-group=icinga-cmd --with-icinga-user=icinga --with-icinga-group=icinga --with-web-user=apache --with-web-group=apache</nowiki>make install}}
DocumentRoot == Install the Icinga Web 2.0 Interface ==Create the Icinga Web db/varuser/pass.{{Code|hda-create-db-and-user icinga_web}}Configure and install the new web interface.{{Code|cd /usr/src/tar -xzf icinga-web-apps1.4.1.tar.gzcd icinga-web-1.4.1./configure <nowiki>--with-web-user=apache --with-web-group=apache --with-web-apache-path=/etc/httpd/conf.d</nowiki>make installmake install-apache-configmake db-initialize#Choose y for every question asked by make db-initialize}}Now we need to do the same thing with the virtual server as we did originally with the Icinga install so that it shows up for our Virtual Host.{{Code|ls /etc/httpd/conf.d/ <nowiki>|</nowiki> grep icinga#you should see two files. Something like 1002-icinga.conf and icinga-web.confcat /htmletc/httpd/conf.d/icinga-web.conf >> /etc/httpd/conf.d/1002-icinga.conf#Now edit /etc/httpd/conf.d/1002-icinga.confvim /etc/httpd/conf.d/1002-icinga.conf#and move </VirtualHost> from the middle of the file to the end.#be sure to confirm that the contents of icinga-web.conf are within 1002-icinga.conf before removing itrm -f /etc/httpd/conf.d/icinga-web.conf*}}Restart icinga, idoutils, and apache.{{Code|service icinga restartservice httpd restart}}Go to the webpath (http://icinga/icinga-web/) and check if the webinterface starts without exceptions (database connections web and api). You can login with user 'root' and password 'password'.
<Directory "== Install the Icinga Mobile Interface ==Time for more source work!{{Code|cd /varusr/hdasrc/#if you want the latest then run git clone http:/web-apps/git.icinga.org/html">icinga-mobile.git Options Indexes FollowSymLinks +ExecCGI AddHandler fcgidunzip icinga-mobile-script 0.fcg1.0.zip AllowOverride AuthConfigcd icinga-mobile Order allow,denyautoconf Allow from all ./configure <nowiki>--with-web-user=apache --with-web-group=apache --with-web-apache-path=/etc/httpd/conf.d</Directorynowiki>make compilemake installmake install-apache-config}}
ErrorLog Now we need to do the same thing with the virtual server as we did originally with the Icinga install so that it shows up for our Virtual Host.{{Code|ls /etc/httpd/conf.d/ <nowiki>|</nowiki> grep icinga#you should see two files. Something like 1002-icinga.conf and icinga-mobile.confcat /etc/httpd/conf.d/icinga-mobile.conf >> /etc/varhttpd/hdaconf.d/web1002-appsicinga.conf#Now edit /Icingaetc/httpd/logsconf.d/error_log1002-icinga.conf CustomLog vim /varetc/hdahttpd/webconf.d/1002-appsicinga.conf#and move </IcingaVirtualHost> from the middle of the file to the end.#be sure to confirm that the contents of icinga-mobile.conf are within 1002-icinga.conf before removing itrm -f /etc/httpd/logsconf.d/access_log combined env=!dontlogicinga-mobile.conf*}}Restart icinga, idoutils, and apache.{{Code|service httpd restart}}
#this is the beginning of the part from icinga.conf ScriptAlias /icingaNow go to http:/cgi-bin "/usr/local/icinga/sbin" <Directory "/usr/local/icinga/sbin"-web and log in as root. Click on Admin >Users and Add new user. Give it the following settings. Options ExecCGI* User name: mobile AllowOverride None* Auth via: auth_key Order allow,deny* password: whateveryouwant (different the the Api authkey) Allow from all* Authkey for Api (optional): mobileaccess AuthName "Icinga Access" AuthType Basic AuthUserFile /usr/local/icinga/etc/htpasswd.users Require valid-* Make sure that the moble user </Directory> Alias /icinga "/usr/local/icinga/share/" <Directory "/usr/local/icinga/share/"> Options None AllowOverride None Order allowis part of these groups: appkit_user,denyicinga_user Allow from all AuthName "Icinga Access" AuthType Basic AuthUserFile /usr/local/icinga/etc/htpasswd* The rest of the settings you can fill in what ever you want.users Require valid-user </Directory></VirtualHost></nowiki></pre>}}
NOTENow on your iPhone or Android phone visit http: The //icinga/icinga-mobile. After it says request failed click on config. Change the Icinga instructions Web URL to reflect your server name. For instance my server is icinga.home so your URL should be rewritten so that it conforms http://icinga.home/icinga-web. Make the Auth key "mobileaccess" without quotes.=== Known Issues ===* You have to make the server for icinga-web the exact same as what you access icinga-mobile on the config page of Icinga Mobile. For security reasons cross domain AJAX requests are denied. Example if you're accessing http://xyz/icinga-mobile then Icinga Web URL must be http://xyz/icinga-web.* Icinga Mobile works neither with the desktop or mobile version of Firefox.* You may have to visit your fully qualified domain name on your mobile phone to access Icinga. For instance going to http://icinga.home/icinga-mobile instead of http://icinga/icinga-mobile because the mobile browsers will attempt to search it like icinga app path is a keyword for Amahi standardsa search engine.
= Go to Icinga Overview and further Amahi integration =Now visit To get a better understanding of how Icinga at{{Link|works [http://icingawww.youtube.com/icinga}}You can add a simple html redirect to /var/hda/web-apps/icinga/html/indexwatch?v=jLqhXvGTazI view this video].html to automatically redirect So basically you so that have the Icinga core which runs locally on the machine. Then you only have to visit http://icinga/access the core using the Classic Web Interface, Icinga Web 2.0, and Icinga Mobile.
== TODO: Add Icinga servers to the Admin CP ==When I update the instructions IYou will want to add two servers to your HDA Admin Control Panel. One for Icinga and one for IDOUtils.{{Code|<nowiki>echo 'll write compiling instructions toServer.create(:* Install name => "icinga to ", :comment => "Icinga")' | (cd /var/hda/web-apps/icingaplatform/html/icinga&& . * Create a ScriptAlias to /cgi-bin instead of script/icinga/cgi-bin* Create an Alias to / instead of /icinga so that a user only need to visit http://icingaconsole production)</nowiki>}}
That{{Code|<nowiki>echo 's all for now.Server.create(:name => "ido2db", :comment => "IDOUtils")' | (cd /var/hda/platform/html && ./script/console production)</nowiki>}}
[[UserNow go to http:Sag47|Sag47]] 21:37, 10 June 2011 (PDT)//hda and visit Setup > Settings > Servers and you will see Icinga and IDOUtils showing up at the bottom.
== Smarter index.html ==Wouldn't it be awesome if when you visit http://icinga that it would default to the classic interface if JavaScript is disabled, default to web 2.0 interface if Javascript is enabled, or default to the mobile interface if you're visiting from a mobile phone? Well you can if you configure your server right. # Browse to ''/var/hda/web-apps/icinga/html/''.# Visit my [[Categoryhttp:Apps]//sourceforge.net/projects/webtechtools/files/Javascript%20Browser%20Detect/ sourceforge project]and download the latest browser_detect.js_XXXX.# Unzip browser_detect.js to ''/var/hda/web-apps/icinga/html/''# Create /var/hda/web-apps/icinga/html/index.html with the following contents.{{Text|Text=<pre><nowiki><html><head><title>Icinga Monitoring Server</title><meta HTTP-EQUIV="REFRESH" content="1; url=/icinga/"><script type="text/javascript" src="browser_detect.js"></script><script type="text/javascript">window.top.location.href=(isMobile)?"/icinga-mobile/":"/icinga-web";</script></head><body></body></html></nowiki></pre>}}
61

edits