Saturday, April 20, 2024
47
rated 0 times [  47] [ 0]  / answers: 1 / hits: 81007  / 2 Years ago, tue, december 28, 2021, 6:23:33

I keep hearing about Nagios, a really powerful tool for monitoring servers. How do I install it?


More From » software-installation

 Answers
2

First of all, I'm assuming that you're doing this on a stock, brand-spanking new install of 12.04. Nothing special happening here.



Install nagios:



sudo apt-get install -y nagios3


It will go through, and ask you about what mail server you want to use:



enter image description here



Pick one based upon your needs.



enter image description here



It will then ask you about the domain name you want to have email sent from. Again, fill that out based upon your needs.



It will ask you what password you want to use - put in a secure password. This is for the admin account nagiosadmin.



enter image description here



And then you'll need to verify your password.



Once the install is all done, you can head over to localhost/nagios3 (or whatever the IP address/domain name of the server you installed it on is) and you'll be asked to enter your password:



enter image description here



Once you've done that, you're in!



enter image description here



Little ugly, huh?



Nagios automatically adds in the 'localhost' to the config, and does load, current users, disk space, http and ssh checks.



enter image description here



Now there is one more thing we need to do before nagios is all ready - we need to have it accept external commands so we can acknowledge problems, add comments, etc.



To do that, we need to edit a few files. Start by opening /etc/nagios3/nagios.cfg with the following command:



sudo nano /etc/nagios3/nagios.cfg


Search for check_external_commands, and turn the check_external_commands=0 into check_external_commands=1.



Now, restart apache by running



sudo service apache2 restart


Not done yet! We need to edit /etc/group. There should be a line like this in there:



nagios:x:114


Change it to



nagios:x:114:www-data


Save and close this file.



Now, we need to edit the /var/lib/nagios3/rw files permission with:



sudo chmod g+x /var/lib/nagios3/rw


And then (because of how permissions work) we need to edit the permissions of the directory above that with:



sudo chmod g+x /var/lib/nagios3


Now, restart nagios with:



sudo service nagios3 restart


If you use Apache as your web server, restart that also:



sudo service apache2 restart


And you should be good to go! Happy monitoring!



To have alerts emailed to you, see this question and answer.


[#37926] Tuesday, December 28, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uxuriousrnal

Total Points: 279
Total Questions: 106
Total Answers: 96

Location: Fiji
Member since Wed, Mar 29, 2023
1 Year ago
uxuriousrnal questions
Wed, Mar 9, 22, 09:04, 2 Years ago
Mon, Jul 18, 22, 01:48, 2 Years ago
Wed, Apr 13, 22, 01:15, 2 Years ago
Thu, Aug 26, 21, 22:01, 3 Years ago
;