Page 1 of 1
Performance Graph issue
Posted: Wed Apr 26, 2017 6:13 pm
by JohnFLi
I recently added a new service check (checking the memory Tomcat7.exe is using) a few days ago and I was wanting to look at it's performance graph.
in the image below, it appears 2 out of 5 has any graphing data.
PerformanceGraph1.jpg
If I go to view either graph, this is what I see:
PerformanceGraph2.jpg
this is how I have the check setting for it set:
PerformanceGraph3.jpg
Any ideas how to get this to work correctly?
Re: Performance Graph issue
Posted: Thu Apr 27, 2017 9:03 am
by tgriep
The performance data output from your check may not be correct or that there is not any output at all, XI cannot generate a graph.
Can you go the Service Details menu and select one of the services, go to the Advanced Tab, screen capture it and post it here?
Also, can you post how the command is setup in the Core Config Manager and post that here?
If you go to the CCM > Services menu, find the service and click on the Floppy icon, copy and paste the settings here so we can view them.
Re: Performance Graph issue
Posted: Thu Apr 27, 2017 10:11 am
by JohnFLi
Here is the first item:
PerformanceGraph4.jpg
second item: Command setup:
PerformanceGraph5.jpg
third item:
Code: Select all
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date: 2017-04-27 08:08:51
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name G1VPENDMDEX01
service_description CPU Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!!CPULOAD!-l 5,80,90!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options w,c,r,
contacts Brian Deter,Brittany Schenk,Paul Howell,Vinny Rapisarda
contact_groups G1VPENDMDEX0x
_xiwizard windowsserver
register 1
}
define service {
host_name G1VPENDMDEX01
service_description Drive C: Disk Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!!USEDDISKSPACE!-l C -w 80 -c 95!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options w,c,r,
contacts Brian Deter,Brittany Schenk,Paul Howell,Vinny Rapisarda
contact_groups Endeca,G1VPENDMDEX0x
_xiwizard windowsserver
register 1
}
define service {
host_name G1VPENDMDEX01
service_description Memory Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!!MEMUSE!-w 85 -c 90!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options w,c,r,
contacts Brian Deter,Brittany Schenk,Paul Howell,Vinny Rapisarda
contact_groups G1VPENDMDEX0x
_xiwizard windowsserver
register 1
}
define service {
host_name G1VPENDMDEX01
service_description Ping
use xiwizard_windowsserver_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options w,c,r,
contacts Brian Deter,Brittany Schenk,Paul Howell,Vinny Rapisarda
contact_groups G1VPENDMDEX0x
_xiwizard windowsserver
register 1
}
define service {
host_name G1VPENDMDEX01
service_description Tomcat Memory
display_name Tomcat Memory
check_command check_nrpe!check_tomcat!-a '3900 4000'!!!!!!
initial_state o
max_check_attempts 3
check_interval 10
retry_interval 5
active_checks_enabled 1
check_period 24x7
process_perf_data 1
notification_interval 5
first_notification_delay 0
notification_period 24x7
notifications_enabled 1
contacts Janis Angelini,Janis Angelini_TXT,John Litster
register 1
}
define service {
host_name G1VPENDMDEX01
service_description Uptime
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!!UPTIME!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options w,c,r,
contacts Brian Deter,Brittany Schenk,Paul Howell,Vinny Rapisarda
contact_groups Endeca,G1VPENDMDEX0x
_xiwizard windowsserver
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
The powershell script that runs on the machine:
Code: Select all
param($warn, $crit)
$myTomCat = "0"
$hostname = $env:COMPUTERNAME
$now = Get-Date
$username = "firemountain\nagios"
$password = "9R9FEhGW3e%"
$CpuCores = (Get-WMIObject Win32_ComputerSystem).NumberOfLogicalProcessors
$secstr = New-Object -TypeName System.Security.SecureString
$password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
[string[]]$recipients = "[email protected]"
$LastExitCode = 3
$output = ""
$myTomCat = Get-Process Tomcat7 | Sort -Descending WorkingSet64 | select -first 1 | Measure-Object WS -Sum
$myTomCat = Get-Process TomCat7| select WorkingSet64 | Sort-Object WorkingSet64 -desc | select -first 1 | Measure-Object WorkingSet64 -Sum
$myTomCat = $myTomCat.sum / 1mb
if ($myTomCat -gt $crit)
{
$output = "CRITICAL: Memory for Tomcat has passed 3.5 gig $myTomCat on $hostname"
$output1 = $output | out-file c:\scripts\tomcatmemoryprocess.txt
send-mailmessage -to "$recipients" -from "Nagios <[email protected]>" -subject "tomcat on $hostname on $now" -body "$output" -Attachments "c:\scripts\tomcatmemoryprocess.txt" -smtpserver exchange.firemountain.local -Credential $cred
$LastExitCode = 2
}
elseif ($myTomCat -gt $warn)
{
$output = "WARN: Memory for tomcat is getting close to 3.5 gig $myTomCat"
$LastExitCode = 1
}
else
{
$output = "OK: Everything seems to be fine $myTomCat"
$LastExitCode = 0
}
Write-Host $output
exit $LastExitCode
Re: Performance Graph issue
Posted: Thu Apr 27, 2017 10:51 am
by tgriep
If you look at the Advanced Tab, you will see that the Performance Data field is empty, that is the reason the graphs are not getting generated.
You will have to add that to your powershell script and the following link describes the format output for Performance Data
https://nagios-plugins.org/doc/guidelines.html#AEN200
Re: Performance Graph issue
Posted: Thu Apr 27, 2017 10:59 am
by JohnFLi
ahhhh - man.....you're going to make me think again.
I will check it out and see what kind of results I get.
I will report back later
Re: Performance Graph issue
Posted: Thu Apr 27, 2017 11:32 am
by tgriep
OK, let us know the results.
Re: Performance Graph issue
Posted: Fri Apr 28, 2017 10:06 am
by JohnFLi
Ok, I'm getting performance data:
Code: Select all
Performance Data: 'Memory useage'=3286.48046;3900;4000;0;5000
But service attributes still shows a blank in the 'action' column
The graph page does display, but all number show zero
When I run the check command, it returns:
Code: Select all
[[email protected] ~]$ /usr/local/nagios/libexec/check_nrpe -H G1VPENDMDEX01 -t 700 -c check_tomcat -a '3900 4000'
OK: Everything seems to be fine 3350.13671875|'Tomcat Memory'=3350.13671;3900;4000;0;5000
The output line of my powershell is:
Code: Select all
Write-Host "$output| 'Tomcat Memory'=$myTomCat;$warn;$crit;0;5000"
Re: Performance Graph issue
Posted: Fri Apr 28, 2017 10:32 am
by tgriep
The graph could be showing the incorrect info because when you were working on the plugin, the files could of been corrupted so if you delete the .xml and .rrd files for that service, they should get recreated and hopefully graph correctly.
The files can be found in this folder under the hostname of the system.
Code: Select all
/usr/local/nagios/share/perfdata/<hostname>
Re: Performance Graph issue
Posted: Fri Apr 28, 2017 1:49 pm
by JohnFLi
Outstanding! Thant took care of it.
Thank you
You can close this item.