Page 1 of 2
how to do this graphing in nagios
Posted: Sat Dec 12, 2015 4:17 pm
by h.sabrey
Hello Gents,
as long as my work with nagios core continues my linux experience is improving "Thanks Nagios", and of course much more requirements pops up.
we have the devices of mikrotik, ubnt, and cisco in the network and of course linux servers for radius and nagios which all needed to be monitored. now, after installing nagios, i want to monitor the network in terms of SNMP parameters graphing it and record this data for 30 days.
SNMP parameters are (PING, Traffic, CPU load, up-time) and the bandwidth of the internet.
how to start and where to begin, if any problems faced, it'll be posted here, to make knowledge available for all.
Re: how to do this graphing in nagios
Posted: Mon Dec 14, 2015 1:34 am
by Box293
Install PNP4Nagios
https://sites.google.com/a/box293.com/n ... core-4-0-x
Let us know how this goes for you.
Re: how to do this graphing in nagios
Posted: Tue Dec 15, 2015 8:58 pm
by h.sabrey
thanks for the link, but is the only graphing tool for nagios?
Re: how to do this graphing in nagios
Posted: Tue Dec 15, 2015 9:16 pm
by Box293
There are other tools available, PNP4Nagios is the only one I've played with.
https://exchange.nagios.org/directory/A ... d-Trending
Re: how to do this graphing in nagios
Posted: Wed Dec 16, 2015 6:39 pm
by h.sabrey
what about MRTG, is it integratable to the Nagios?
Re: how to do this graphing in nagios
Posted: Wed Dec 16, 2015 6:43 pm
by Box293
It certainly is.
Honestly I use Nagios XI which includes MRTG so I've never had to set it up from scratch, however I'm sure if you follow the documentation you'll get it working.
Re: how to do this graphing in nagios
Posted: Wed Dec 16, 2015 7:55 pm
by h.sabrey
Box293 wrote:It certainly is.
Honestly I use Nagios XI which includes MRTG so I've never had to set it up from scratch, however I'm sure if you follow the documentation you'll get it working.
which documentation, describe the integration between nagios and MRTG
Re: how to do this graphing in nagios
Posted: Thu Dec 17, 2015 1:06 pm
by rkennedy
I couldn't find much instruction on MRTG / Nagios, but I will direct you to our exchange which has a Graphing addons available.
https://exchange.nagios.org/directory/A ... d-Trending
Re: how to do this graphing in nagios
Posted: Thu Dec 24, 2015 6:19 am
by h.sabrey
while the installation the last part about editing the command.cfg and the nagios.cfg
for the nagios.cfg
command to be executed from the website is :-
Code: Select all
Type sed -i 's/^#host_perfdata_file_template=.*/host_perfdata_file_template=DATATYPE::HOSTPERFDATA\\tTIMET::$TIMET$\\tHOSTNAME::$HOSTNAME$\\tHOSTPERFDATA::$HOSTPERFDATA$\\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\\tHOSTSTATE::$HOSTSTATE$\\tHOSTSTATETYPE::$HOSTSTATETYPE$/g' /usr/local/nagios/etc/nagios.cfg and press Enter
Type sed -i 's/^#service_perfdata_file_template=.*/service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\\tTIMET::$TIMET$\\tHOSTNAME::$HOSTNAME$\\tSERVICEDESC::$SERVICEDESC$\\tSERVICEPERFDATA::$SERVICEPERFDATA$\\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\\tHOSTSTATE::$HOSTSTATE$\\tHOSTSTATETYPE::$HOSTSTATETYPE$\\tSERVICESTATE::$SERVICESTATE$\\tSERVICESTATETYPE::$SERVICESTATETYPE$/g' /usr/local/nagios/etc/nagios.cfg and press Enter
command in the original file is
Code: Select all
#host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
#service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
what i understood that we need to uncomment the lines in the original file while the comment in the website is quite different.
Re: how to do this graphing in nagios
Posted: Fri Dec 25, 2015 8:17 am
by h.sabrey
great thanks for BOX293, only something related to configuration
##
we want to monitor and graph the PING, || Port1, Port2, Port3,.... etc || and the most important the bandwidth of Port1 in each device.
the configuration is done according to the 3 file strtgy, i.e. file1= routerhostgroups.cfg, file2= routerservicegroup.cfg, file3= xx_routername.cfg
below is the configuration of :
:::: File1
Code: Select all
define hostgroup{
hostgroup_name Local_Routers ; The name of the hostgroup
# alias Local Routers ; Long name of the group
}
:::: File2
Code: Select all
# Create a service to PING to router
define service{
use generic-service ; Inherit values from a template
hostgroup_name Local_Routers ; The name of the hostgroup the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
# Monitor uptime via SNMP
define service{
use generic-service ; Inherit values from a template
hostgroup_name Local_Routers ; The name of the hostgroup the service is associated with
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
# Monitor Port 1 status via SNMP
define service{
use generic-service ; Inherit values from a template
hostgroup_name Local_Routers ; The name of the hostgroup the service is associated with
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}
# Monitor bandwidth via MRTG logs
define service{
use generic-service ; Inherit values from a template
hostgroup_name Local_Routers ; The name of the hostgroup the service is associated with
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.20_1.log!AVG!1000000,1000000!5000000,5000000!10
}
# 192.168.1.20 is the router Port1 IP
:::: File3
Code: Select all
# 001.MySite1
define host{
use generic-router ; Inherit default values from a template
host_name 001.MySite1 ; The name we're giving to this Router
# alias 001.MySite1 ; A longer name associated with the Router
address 192.168.1.20 ; IP address of the Router
hostgroups Local_Routers, 03-Al-Mahari ; Host groups this Router is associated with
but...
when getting in the nagiosserver/nagios/pnp/index.php the only graphed is the "001.MySite1" Host & Ping.
want to graph the:-
1- per single host => PING, Port1 status, uptime & Traffic bandwidth for Port1
2. sum of (Traffic bandwidth of port1 of all devices) . this to know the overall traffic consumed