About NagVis
NagVis is an addon to Nagios monitoring and alerting system. It is a way to vizualize Nagios data. It enables you to create maps and schemas of a part or the whole server and network infrastructure. Viewing these maps you can quickly see which hosts and services or even branches of your company are up and running and which not.
IMPORTANT! NagVis requires MK Livestatus to be installed. To view MK Livestatus install guide you click here.
1. Check services
Check Nagios Core and MK Livestatus are running OK. Before we can start installing we need to check that Nagios Core and MK Livestatus are successfully installed on our server!Quick check – find livestatus.so and check nagios service status:
2. Download NagVis
Download the latest tar from http://www.nagvis.org/ and transfer it to server.
3. Install dependencies
4. Extract tar package
5. Run install script
Run install script and go through the installation process – the main thing is that you specify the correct path to your MK Livestatus socket:When installation is complete something like this will print out with all of the information necessary to access the web frontend:You can now add and configure your hosts and services in your web frontend accessible at http://hostname.domainname/nagvis or http://IPADDR/nagvis.Tagged with: centos6, install, nagvisShareFacebook, Twitter, Google Plus, Pinterest, EmailYou May Also Like
Running latest Apache 2.4 with PHP 7.0 on CentOS 6
First things first, why CentOS 7 instead of 6? Well, CentOS 6 has issues with Python updating because of yum. Yes, you can install a separate instance, but it’s not fun and it can break down the road. Second, why not use the OVA provided by Nagios? As of September 2017, the version of Python on the OVA is ancient — 2.6.6. And because yum is tied to it, you can’t update it or you need to install a separate instance. Yuck! Just do yourself a favor and use CentOS 7 instead. ? Last but not least, it is super easy to do!Download the latest version of CentOS. We are going to use the minimal ISO.
Follow the prompts to install minimal CentOS 7. If you are installing virtually, I would recommend 2 CPUs, 2GB of RAM, and 50GB of hard disk (thin provisioned is fine).
After the install completes, run the command below to ensure you are on the latest packages as well.
While there, also install the net-tools and mlocate packages… You’ll thank me later!
If you are installing on ESXi/VMWare as a virtual machine, go ahead and add the VM tools as well.
At this point, a reboot is probably a good idea if you haven’t already. If you install the VM tools, a reboot is necessary before info will show up in ESXi/VMWare.
Next, go ahead and install Nagios XI using the command below.
If that doesn’t work, follow the guide at the link below instead.
Now just login via using your web browser of choice using the IP address shown on the screen, e.g. http://192.168.4.10/nagiosxi
Follow the onscreen commands and you are good to go… But wait!
So you think you’re done because you can login? Wrong! You should always access your Nagios console via HTTPS instead of HTTP. The problem is the Nagios XI installer doesn’t open up 443/HTTPS by default. No big deal, a couple of commands below and we are good to go.
Dallas Haselhorst has worked as an IT and information security consultant for over 20 years. During that time, he has owned his own businesses and worked with companies in numerous industries. Dallas holds several industry certifications and when not working or tinkering in tech, he may be found attempting to mold his daughters into card carrying nerds and organizing BSidesKC.
Share this post!
This tutorial will guide you on how to perform a minimal installation of latest version of CentOS 7.0, using the binary DVD ISO image, an installation that is best suitable for developing a future customizable server platform, with no Graphical User Interface, where you can install only the software that you need.
If you want to find out more about what’s new in this release of CentOS 7.0 holds and download links, I suggest reading the previous article on release announcements:
Requirements
- CentOS 7.0 DVD ISO
CentOS 7.0 Installation Process
1. After downloading the last version of CentOS using above links or using official CentOS download page. Burn it to a DVD or create a bootable USB stick using LiveUSB Creator called Unetbootin.
2. After you have created the installer bootable media, place your DVD/USB into your system appropriate drive, start the computer, select your bootable unit and the first CentOS 7 prompt should appear. At the prompt choose Install CentOS 7 and press [Enter] key.
CentOS 7 Boot Menu
3. The system will start loading media installer and a Welcome screen should appear. Select your Installation Process Language, that will assist you through the entire installation procedure and click on Continue.
Select Installation Process Language
4. The next step, present screen prompt is Installation Summary. It contains a lot of options to fully customize your system. First thing you may want to setup is your time settings. Click on Date & Time and select your server physical location from the provided map and hit on upper Done button to apply configuration.
5. The next step is to choose your Language Support and Keyboard settings. Choose your main and extra language for your system and when you’re finished hit on Done button.
Select Language and Keyboard
6. The same way choose your Keyboard Layout by hitting the plus button and test your keyboard configuration using the right input filed. Buy operation flashpoint red river. After you finish setting up your keyboard, again hit on upper Done button to apply changes and go back to main screen on Installation Summary.
Choose Keyboard Layout
7. On the next step you can customize your installation by using other Installation Sources than your local DVD/USB media, such as a network locations using HTTP, HTTPS, FTP or NFS protocols and even add some additional repositories, but use this methods only if you know what you’re doing. So leave the default Auto-detected installation media and hit on Done to continue.
Choose Installation Sources
8. On the next step you can choose your system installation software. On this step CentOS offers a lot of Server and Desktop platform environments that you choose from, but, if you want a high degree of customization, especially if you are going to use CentOS 7 to run as a server platform, then I suggest you select Minimal Install with Compatibility Libraries as Add-ons, which will install a minimal basic system software and later you can add other packages as your needs require using yum groupinstall command.
Software Selection
9. Now it’s time to partition your hard-drive. Click on Installation Destination menu, select your disk and choose I will configure partitioning.
Choose Installation Destination
10. On the next screen, choose LVM (Logical Volume Manager) as partition layout and, then, click on Click here to create them automatically, option which will create three system partition using XFS filesystem, automatically redistributing your hard-disk space and gathering all LVS into one big Volume Group named centos.
- /boot – Non LVM
- /(root) – LVM
- Swap – LVM
Select LVM Partition Type
How To Install Nagvis On Centos Versions
11. If you are not pleased with the default partition layout done automatically by the installer you can completely add, modify or resize your partition scheme and when you finish hit on Done button and Accept Changes on the Summary of Changes prompt.
Summary of Partition Changes
NOTE: For those users, who have hard-disks more than 2TB in size, the installer automatically will convert partition table to GPT, but if you wish to use GPT table on smaller disks than 2TB, then you should use the argument inst.gpt to the installer boot command line in order to change the default behaviour.
12. The next step is to set your system hostname and enable networking. Click on Network & Hostname label and type your system FQDN (Fully Qualified Domain Name) on Hostname filed, then enable your Network interface, switching the top Ethernet button to ON.
If you have a functional DHCP server on you network then it will automatically configure all your network setting for enabled NIC, which should appear under your active interface.
Enable Ethernet Interface
13. If your system will be destined as a server it’s better to set static network configuration on Ethernet NIC by clicking on Configure button and add all your static interface settings like in the screenshot below, and when you’re finished hit on Save button, disable and enable Ethernet card by switching the button to OFF and ON, and, then hit on Done to apply setting and go back to main menu.
14. Now it’s time to start installation process by pressing on Begin Installation button and set up a strong password for root account.
Click on Begin Installation
Enter Root Password
15. After you finish setting up a strong password for root account move to User Creation and create your first system user. You can designate this user to become a System Admin with root privileges using sudo command by checking the box Make this user administrator, then click on Done to go back on main menu and wait for the installation process to finish.
User Creation and Set Password
16. After the installation process finishes, the installer will show a successfully message on screen, demanding to reboot your system in order to use it.
Congratulation! You have now installed last version of CentOS on your bare new machine. Remove any installation media and reboot your computer so you can login to your new minimal CentOS 7 environment and perform other system tasks, such as update you system and install other useful software needed to run day to day tasks.
Nagios,Pnp4Nagios & Nagvis installation on centos
20 Steps total
Step 1: Installation of apache
sudo yum install httpd
sudo service httpd start
sudo yum install php php-mysql
Step 2: Download packages & extract
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.2.tar.gz
wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
tar -xzf nagios-4.3.2.tar.gz
tar -xzf nagios-plugins-2.2.1.tar.gz
rm -rf *.tar.gz
Step 3: install required packages
yum install httpd php gcc glibc glibc-common gd gd-devel perl unzip -y
Step 4: add users and give rights
/usr/sbin/useradd -m nagios
passwd nagios
/usr/sbin/groupadd nagcmd # Used for Web Interface
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
Step 5: compile the extracted code
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
now setup security for the front end
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
systemctl restart nagios && systemctl restart httpd
Step 6: Install nagios plugins
tar xzf nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Add Nagios services
chkconfig --add nagios
chkconfig nagios on
Verify the sample Nagios configuration files.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start
Step 7: Disable selinux
nano /etc/sysconfig/selinux
and set SELINUX=disabled
reboot the machine
Step 8: Add firewall rules
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=444/tcp --permanent
firewall-cmd --zone=public --add-port=25/tcp --permanent
firewall-cmd --reload
systemctl restart nagios
systemctl restart httpd
Step 9: Installation NRPE
yum groupinstall 'Development Tools'
download http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar -xzf nrpe
cd nrpe
yum install -y gcc glibc glibc-common openssl openssl-devel perl wget
./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
make all
make install
make install-xinetd
make install-daemon-config
nano /etc/xinetd.d/nrpe
and add only_from = your interal ip
service xinetd restart
Step 10: Installation pnp4nagios
yum install rrdtool perl-Time-HiRes rrdtool-perl php-gd
download pnp4 nagios
extract
cd
(https://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.26.tar.gz)
./configure
make
make all
make fullinstall
chkconfig --add npcd && chkconfig --level 35 npcd on
systemctl reload httpd
mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install.php-ori
Step 11: edit nagios.cfg
usr/local/nagios/etc/nagios/.cfg
add / edit
# Bulk / NPCD mode
process_performance_data=1
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tSERVICEDESC::$SERVICEDESC$tSERVICEPERFDATA::$SERVICEPERFDATA$tSERVICECH$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tHOSTPERFDATA::$HOSTPERFDATA$tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$tHOSTSTATE::$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
Step 12: edit commands.cfg
# 'process-host-perfdata' command definition
define command{
command_name process-host-perfdata
command_line /usr/bin/printf '%b' '$LASTHOSTCHECK$t$HOSTNAME$t$HOSTSTATE$t$HOSTATTEMPT$t$HOSTSTATETYPE$t$HOSTEXECUTIONTIME$t$HOSTOUTPUT$t$HOSTPERFDATA$$
}
# 'process-service-perfdata' command definition
define command{
command_name process-service-perfdata
command_line /usr/bin/printf '%b' '$LASTSERVICECHECK$t$HOSTNAME$t$SERVICEDESC$t$SERVICESTATE$t$SERVICEATTEMPT$t$SERVICESTATETYPE$t$SERVICEEXECUTIONTIME$$
}
define command{
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
}
define command{
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$
}
Step 13: edit templates.cfg
define host {
name host-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_'s domain
my $opt_token = 'yoursecret'; # The token from your Nagios services page
Step 19: edit contacts
define contact {
contact_name slack
alias Slack
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-slack
host_notification_commands notify-host-by-slack
}
Step 20: additional packages
for some script you need these packages
yum install cpan
cpan : install Net::DNS
yum install php-gd
yum install gd-progs
1 Comment
- Sonoradmle Feb 27, 2019 at 10:33pm
First thank you for great how-to, second, this tutorial will work with CentOS 7 (lastest)?
I'm trying to install NagVis and it seems that something goes wrong. The question is why? I've tried to follow the dokumentation -> http://assets.nagios.com/downloads/nagiosxi/docs/Integrating_Nagvis_With_XI.pdf, but..
- Code: Select all
[root@localhost tmp]# ./NagiosXI-Nagvis.sh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.softaculous.com
* epel: ftp.nluug.nl
* extras: mirrors.se.kernel.org
* updates: mirrors.se.kernel.org
Setting up Install Process
Package graphviz-2.22.0-4.el5.rf.i386 already installed and latest version
Package php-gd-5.1.6-27.el5_5.3.i386 already installed and latest version
Package php-mbstring-5.1.6-27.el5_5.3.i386 already installed and latest version
Package php-mysql-5.1.6-27.el5_5.3.i386 already installed and latest version
Package php-pdo-5.1.6-27.el5_5.3.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package graphviz-gd.i386 0:2.12-8.el5 set to be updated
--> Processing Dependency: graphviz = 2.12-8.el5 for package: graphviz-gd
---> Package php-xml.i386 0:5.1.6-27.el5_5.3 set to be updated
--> Finished Dependency Resolution
graphviz-gd-2.12-8.el5.i386 from epel has depsolving problems
--> Missing Dependency: graphviz = 2.12-8.el5 is needed by package graphviz-gd-2.12-8.el5.i386 (epel)
Error: Missing Dependency: graphviz = 2.12-8.el5 is needed by package graphviz-gd-2.12-8.el5.i386 (epel)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.softaculous.com
* epel: ftp.nluug.nl
* extras: mirrors.se.kernel.org
* updates: mirrors.se.kernel.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-json.i386 0:1.2.1-4.el5 set to be updated
---> Package php53-common.i386 0:5.3.3-1.el5_6.1 set to be updated
--> Processing Conflict: php53-common conflicts php-common
--> Finished Dependency Resolution
php53-common-5.3.3-1.el5_6.1.i386 from updates has depsolving problems
--> php53-common conflicts with php-common
Error: php53-common conflicts with php-common
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
Reloading httpd: [ OK ]
NagVis Installation Complete!
[root@localhost tmp]#
I can see there are a problem at the dependency resolvation. Does it make sense to any of you?