Nagios: Miscellaneous notes on installing and configuring Nagios. 
[acool@localhost ~]$ 
[acool@localhost ~]$ date
Mon 07 Dec 2020 05:45:53 PM PST
[acool@localhost ~]$
[acool@localhost ~]$ cat /etc/redhat-release
Fedora release 31 (Thirty One)
[acool@localhost ~]$
[acool@localhost ~]$ sudo dnf install httpd nagios nagios-common nagios-plugins-all
Last metadata expiration check: 0:36:12 ago on Mon 07 Dec 2020 05:09:52 PM PST.
Package httpd-2.4.46-1.fc31.x86_64 is already installed.
Package nagios-4.4.5-7.fc31.x86_64 is already installed.
Package nagios-common-4.4.5-7.fc31.x86_64 is already installed.
Package nagios-plugins-all-2.3.3-2.fc31.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[acool@localhost ~]$
[acool@localhost ~]$ cat /etc/httpd/conf.d/nagios.conf
...
[acool@localhost ~]$
[acool@localhost ~]$ # default password for web ui nagiosadmin:nagiosadmin? I think yes.
[acool@localhost ~]$ ll /etc/nagios/
total 92
-rw-rw-r--. 1 root root 13699 Apr 7 2020 cgi.cfg
-rw-rw-r--. 1 root root 45886 Nov 4 23:23 nagios.cfg
-rw-r--r--. 1 root root 12839 Apr 29 2020 nrpe.cfg
drwxr-x---. 2 root nagios 4096 Nov 5 11:05 objects
-rw-r-----. 1 root apache 27 Apr 7 2020 passwd
drwxr-x---. 2 root nagios 4096 Nov 3 12:22 private
[acool@localhost ~]$
[acool@localhost ~]$ # http://localhost:8080/nagios/ should now load (adjust port as needed)


TODO: nagiosgraph. NEEDS TESTING!!

A.- Looks like we need this in commands.cfg :

define command {
command_name process-service-perfdata-for-nagiosgraph
command_line /usr/local/nagiosgraph/bin/insert.pl
}

B.- And this in templates.cfg :

define service {
name graphed-service
action_url /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=week&rrdopts=-w+450+-j
register 0
}

C.- Then we need to add 'graphed-service' to services in localhost.cfg for example:

# Define a service to "ping" the local machine
define service {

use local-service,graphed-service; Name of service template to use
host_name localhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}

D.- In these in /etc/nagios/nagios.cfg : - NEEDS TO BE VERIFIED

process_performance_data=1
service_perfdata_file=/tmp/perfdata.log
service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=30
service_perfdata_file_processing_command=process-service-perfdata-for-nagiosgraph

More hints :
[root@localhost nagiosgraph]# 
[root@localhost nagiosgraph]# grep -nri nagiosgraph /etc/httpd/
/etc/httpd/conf/httpd.conf:354:#### NAGIOSGRAPH #####
/etc/httpd/conf/httpd.conf:355:include /usr/local/nagiosgraph/etc/nagiosgraph-apache.conf
[root@localhost nagiosgraph]#


See nagiosgraph settings:

http://localhost:8080/nagiosgraph/cgi-b ... config.cgi


[ view entry ] ( 615 views )   |  print article

<<First <Back | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Next> Last>>



2024 By Angel Cool