Page 1 of 3
Memory reports showing no data for few Linux servers
Posted: Tue Feb 09, 2021 1:55 am
by pratikmehta003
Hi Team,
we are seeing one strange thing for reports on memory metric for Linux servers.. for some servers data is showing in graph and for some its not..
when we go to services and do a 'run check command', it displays the current % value... so what could be the issue here?
Re: Memory reports showing no data for few Linux servers
Posted: Tue Feb 09, 2021 4:16 pm
by benjaminsmith
Hi,
Usually, when the performance graphs are not working, it's because the perf files are spooling up and not getting processed. From your description, it sounds like the plugin is returning performance data but just verify this again in the Advanced Tab (+) for the host or service.
perf-data.png
If that's correct, then follow the steps in the article below to increase the
timeout and
load_threshold (to around 50-60), and let me know if the graphs start working again.
Nagios XI - Performance Graph Problems
Regards,
Benjamin
Re: Memory reports showing no data for few Linux servers
Posted: Wed Feb 10, 2021 5:47 am
by pratikmehta003
hi benjamin,
m not seeing performance data info as well for many servers...attached image for reference:
memory screenshot.PNG
Re: Memory reports showing no data for few Linux servers
Posted: Wed Feb 10, 2021 3:30 pm
by benjaminsmith
Hi
@pratikmehta003,
Looks like the plugin does not provide performance data. If you want to double-check this, run the plugin from the CLI as well.
Benjamin
Re: Memory reports showing no data for few Linux servers
Posted: Wed Feb 10, 2021 7:45 pm
by pratikmehta003
Hi benjamin,
just to update here...we are doing memory monitoring via custom script and not default... but its via ncpa method only..
so why is the performance data not being collected and how do i check it from CLI?
Re: Memory reports showing no data for few Linux servers
Posted: Wed Feb 10, 2021 8:00 pm
by pratikmehta003
and from wat i understand the monitoring is happening but the performance data is not collected/stored..
Re: Memory reports showing no data for few Linux servers
Posted: Thu Feb 11, 2021 4:03 pm
by benjaminsmith
Hi
@pratikmehta003,
If you're using a custom plugin that is being called by NPCA, it will be necessary to add the option performance data output. This output must follow the formatting specifications otherwise it cannot be processed by NPCD.
For more information on this, take a look at the performance data guidelines on the following page:
https://nagios-plugins.org/doc/guidelines.html'
--Benjamin
Re: Memory reports showing no data for few Linux servers
Posted: Sun Feb 14, 2021 5:04 am
by pratikmehta003
Hi Benjamin,
When click on link, its stating "The requested URL /doc/guidelines.html' was not found on this server." So can you please send the exact link.
and we are using below script for memory collcection which is placed on the target server and then called in Nagios.
#!/bin/bash
#Script is tested for SUSE
if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]] || [[ -z "$4" ]]; then
echo " Missing Parameters! Syntax: check_xi_ncpa!-t 'mytoken' -P 5693 -M plugins/test.sh -a "-w '10' -c '20'""
exit 2
fi
warning_val=$2
critical_val=$4
#Obtain Used memory using Free command
VAL="$(free -m | awk 'FNR == 2 {print ($2-($4+$6+$7))*(100/$2)}')"
#Convert to Integer for comparison with Warning and Critical Values which are Integer
mem_used=${VAL%.*}
#Compare Memory utilization with threshold values
if [ $mem_used -ge $critical_val ]
then
echo "CRITICAL - Memory Utilization is $mem_used %"
exit 2
elif [ $mem_used -ge $warning_val ]
then
echo "WARNING - Memory Utilization is $mem_used %"
exit 1
else
echo "OK - Memory Utilization is $mem_used %"
exit 0
fi
Re: Memory reports showing no data for few Linux servers
Posted: Mon Feb 15, 2021 2:00 pm
by benjaminsmith
Hi
@pratikmehta003,
Sorry about that, here's the link again:
https://nagios-plugins.org/doc/guidelines.html
Here's the details ( add a pipe character in the output string and then add the performance data )
Nagios 3 and newer will concatenate the parts following a "|" in a) the first line output by the plugin, and b) in the second to last line, into a string it passes to whatever performance data processing it has configured. (Note that it currently does not insert additional whitespace between both, so the plugin needs to provide some to prevent the last pair of a) and the first of b) getting run together.) Please refer to the Nagios documentation for information on how to configure such processing. However, it is the responsibility of the plugin writer to ensure the performance data is in a "Nagios Plugins" format.
This is the expected format:
'label'=value[UOM];[warn];[crit];[min];[max]
Re: Memory reports showing no data for few Linux servers
Posted: Mon Feb 15, 2021 2:07 pm
by pratikmehta003
Hi Benjamin,
For the above case I mentioned will u be able to help where I should define and where it should be called?