[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:software:install_nagios_on_slackware [2015/08/01 11:27 (UTC)] – changed (Slackware 13.37) to (Slackware 14.1, 14.0 & 13.37) arfon | howtos:software:install_nagios_on_slackware [2015/11/27 11:29 (UTC)] – [Install Nagios On Slackware] jamesaxl | ||
---|---|---|---|
Line 4: | Line 4: | ||
- Create the nagios group and user: < | - Create the nagios group and user: < | ||
- | # groupadd -g 213 nagios | + | groupadd -g 213 nagios |
- | # useradd -u 213 -d /dev/null -s /bin/false -g nagios nagios | + | |
</ | </ | ||
- Add the ' | - Add the ' | ||
- | # usermod -aG nagios apache | + | usermod -aG nagios apache |
</ | </ | ||
- Install the Nagios:: | - Install the Nagios:: | ||
- | cpan -i Nagios::Plugin | + | cpan -i Monitoring::Plugin |
</ | </ | ||
- Use [[http:// | - Use [[http:// | ||
* RRDTool | * RRDTool | ||
- | * nagios (currently, the package which can be built using a [[http:// | + | * nagios (currently, the package which can be built using a [[http:// |
* nagios-plugin package | * nagios-plugin package | ||
* nagios-graphing | * nagios-graphing | ||
Line 35: | Line 35: | ||
</ | </ | ||
- Edit ''/ | - Edit ''/ | ||
+ | UNCOMMENT: | ||
+ | # | ||
+ | |||
+ | (or #LoadModule cgi_module lib/ | ||
+ | |||
CHANGE: | CHANGE: | ||
< | < | ||
Line 51: | Line 56: | ||
# | # | ||
| | ||
+ | |||
+ | RIGHT AFTER: | ||
+ | | ||
ADD: | ADD: | ||
| | ||
</ | </ | ||
- Make sure apache starts at boot and start/ | - Make sure apache starts at boot and start/ | ||
- | # chmod 755 / | + | chmod 755 / |
- | # / | + | |
</ | </ | ||
- Set the password for // | - Set the password for // | ||
- | # htpasswd -c / | + | htpasswd -c / |
</ | </ | ||
- (Not sure if this is necessary but, leaving it in until I can test) \\ Make sure nagios starts at boot and start/ | - (Not sure if this is necessary but, leaving it in until I can test) \\ Make sure nagios starts at boot and start/ | ||
Line 90: | Line 98: | ||
- Run the '' | - Run the '' | ||
- | # htpasswd -c / | + | htpasswd -c / |
- | # htpasswd -c / | + | |
</ | </ | ||
- Edit ''/ | - Edit ''/ | ||
Line 97: | Line 105: | ||
authorized_for_all_hosts=nagiosadmin, | authorized_for_all_hosts=nagiosadmin, | ||
</ | </ | ||
+ | |||
+ | |||
+ | ====== TROUBLESHOOTING ====== | ||
+ | ERROR: When browsing to the nagios webpage (as nagiosadmin) you get "You do not have permission" | ||
+ | |||
+ | HINT: Check / | ||
+ | |||
+ | FIX1: Make sure that / | ||
+ | |||
+ | FIX2: In / | ||
+ | UNCOMMENT: Include / | ||
+ | Do the "< | ||
+ | | ||
+ | ----- | ||
+ | |||
+ | ERROR: When clicking on Nagios cgi pages, they are downloaded and not executed. | ||
+ | |||
+ | FIX: Make sure the " | ||
+ | |||
+ | ----- | ||
+ | |||
+ | ERROR: " | ||
+ | |||
+ | FIX: vi / | ||
+ | | ||
+ | TO: $USER1$=/ | ||
+ | |||
+ | ----- | ||
+ | |||
+ | ERROR: I've done the FIXes above and it's still not working... | ||
+ | |||
+ | FIX: Didya restart httpd and/or nagios? | ||
+ | / | ||
+ | / | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Install NRPE On A Target Machine ====== | ||
+ | |||
+ | **ON THE TARGET MACHINE (as root):** | ||
+ | |||
+ | groupadd -g 213 nagios | ||
+ | useradd -u 213 -d /dev/null -s /bin/false -g nagios nagios | ||
+ | |||
+ | Install nagios via SBo (Required by Nagios-plugins) | ||
+ | |||
+ | Install nagios-plugins via SBo (Required by NRPE) | ||
+ | |||
+ | Install nrpe via SBo | ||
+ | |||
+ | Ignore the xinetd stuff, you have to run NRPE as a daemon on Slackware (unless you want to go through the headache of replacing inetd with xinetd) | ||
+ | |||
+ | So, start NRPE in Daemon mode: | ||
+ | chmod 755 / | ||
+ | / | ||
+ | |||
+ | Test NRPE | ||
+ | / | ||
+ | NRPE v2.15 | ||
+ | | ||
+ | / | ||
+ | USERS OK - 1 users currently logged in |users=1; | ||
+ | |||
+ | Add your Nagios server' | ||
+ | vi / | ||
+ | allowed_hosts=127.0.0.1, | ||
+ | |||
+ | chown nagios: | ||
+ | |||
+ | ----- | ||
+ | **ON THE NAGIOS SERVER MACHINE:** | ||
+ | |||
+ | Add the client machine into one of the .cfg files | ||
+ | |||
+ | I did this: | ||
+ | vi / | ||
+ | ADD: | ||
+ | # Definitions for monitoring a linux machine | ||
+ | cfg_file=/ | ||
+ | |||
+ | chown nagios: | ||
+ | |||
+ | vi / | ||
+ | ######################################################### | ||
+ | # Linux configuration file | ||
+ | ######################################################### | ||
+ | | ||
+ | define host { | ||
+ | use linux-server | ||
+ | host_name | ||
+ | alias | ||
+ | address | ||
+ | register | ||
+ | } | ||
+ | define service{ | ||
+ | host_name MyLinuxBox | ||
+ | service_description PING | ||
+ | check_command check_ping!100.0, | ||
+ | max_check_attempts 2 | ||
+ | check_interval 2 | ||
+ | retry_interval 2 | ||
+ | check_period 24x7 | ||
+ | check_freshness 1 | ||
+ | contact_groups admins | ||
+ | notification_interval 2 | ||
+ | notification_period 24x7 | ||
+ | notifications_enabled 1 | ||
+ | register 1 | ||
+ | } | ||
+ | | ||
+ | ######################################################### | ||
+ | # END OF FILE | ||
+ | ######################################################### | ||
+ | |||
+ | chown nagios: | ||
+ | |||
+ | Restart Nagios | ||
+ | / | ||
+ | |||
+ | |||
+ | |||