Documentation of Nagios
Documentation of Nagios
Pre-Requisite:
Before Installing, Connect VM of Ubuntu(Remote) with your local
system because Nagios can be downloaded in Ubuntu Only:
1. Use Putty (Enter Your VM Server Credentials) where nagios
can be setup:
IP Address: 99.99.99.206
2. Now Putty Contains Ubuntu Remote server
(99.99.99.206):
Login as :
PWD: In2IT#$tst
Username: catsuser
Note:
1. Enable IT-Corp Network.
2. Enable Liquid VPN
2. CentOS
3. Oracle Linux
4. Ubuntu
6. Debian
7. Raspbian
8. Fedora
9. Arch Linux
10. Gentoo
11. FreeBSD
12. Solaris
13. Apple OS X
sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php
libapache2-mod-php8.1 libgd-dev
6. Install Binaries
sudo make install
7. Install Daemon
cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz
https://github.com/nagios-plugins/nagios-plugins/archive/release-2.4.12.tar.gz
tar zxf nagios-plugins.tar.gz
cd /tmp/nagios-plugins-release-2.4.6/
sudo ./tools/setup
sudo ./configure
sudo make
sudo make install
Memory usage
CPU load
Disk usage
Service states
Running processes
Installing NS Client ++
1. https://sourceforge.net/projects/nscplus/
2. Write Host of Nagios: 99.99.99.206
3. Enable Check_nt and Check_nrpe
4. Enable ‘1’ in nsclient.ini if there is any ‘0’. Also Check allowed-
host to be 99.99.99.206 or your nagios host server ip address:
CheckDisk = 1
CheckEventLog = 1
NSClientServer = 1
CheckExternalScripts = 1
CheckHelpers = 1
CheckNSCP = 1
CheckSystem = 1
Host:
Services:
These are some kind of services like uptime, CPU load etc.
These will reflect on nagios web interface once setup in this file.
Write your Host name here too.
2.Commands.cfg
Note: Complete Process flow will be explained at last with the help of Block
Diagram.
Don’t Worry 😊
3.Event Handlers
There are two types of event handlers: a) event handler b)
global_host_event_handler
File Path:
cd /usr/local/nagios/etc
Note: You can also implement event handler but for that you have to
mention in
event_handler create-iTop-ticket
event_handler_enabled 1
https://www.itophub.io/wiki/page?id=2_5_0:advancedtopics:nagios
mv filename destination_directory/
In here the :
<php path> is that path where your ubuntu php is located
i.e /usr/bin/php
<yourDirectory> is that directory of ubuntu in which you had paste
both files
createTicket-nagios.php and itopsoaptypes.class.inc.php
http://99.99.99.206/nagios/cgi-bin/status.cgi?host=$this->name$
7. Main.php
Write down OnDisplayRelations() function which actually make a
new tab in Server page(Get new CI menu).
Refer to the itop-nagios-integration
Note:
Note:
The php script will be called with the help of Global Event Handler
but ticket will not create as ‘OK’ state will not pass.
tail -f /usr/local/nagios/var/nagios.log
To check the events every time nagios refreshes
Here You can see Global service Event Handler is called for uptime having
‘OK’ status.
Thank you