Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_snmp_mem.pl plugin giving wrong results #65

Open
vivuu1989 opened this issue Jun 19, 2019 · 5 comments
Open

check_snmp_mem.pl plugin giving wrong results #65

vivuu1989 opened this issue Jun 19, 2019 · 5 comments

Comments

@vivuu1989
Copy link

vivuu1989 commented Jun 19, 2019

We are using GItHub Enterprise as our source code management system and its installed as an appliance in Vmware Esxi.
For monitoring purpose we are using Nagios over SNMP for getting the performance metrics.

Nagios over SNMP ( GHE provides the resource metric by default over SNMP) we enabled SNMPV3 from GHE appliance side

But its noticed that GHE will create a much cached memory which will result in unwanted alerts.

There is 4.6 G of cached memory, how to configure Nagios to alert the threshold for GHE (used-cached) memory instead of just used memory.

Current memory usage on the system is:

free -h

total used free shared buffers cached Mem:
15G 14G 909M 1.5M 375M 4.6G
-/+ buffers/cache: 9.8G 5.9G
Swap: 0B 0B 0B

But in Nagios side is there any way to exclude these linux consumed memory and monitor only the GHE consumed memory alone?

Current Behavior

check_snmp_mem.pl -H XXXXX --login=XXXXX --passwd=XXXXX --privpass=XXXXX --protocols=sha,aes -m -w 90,90 -c 95,95 -v

Alarm at 15
SNMPv3 AuthPriv login : XXXXX, sha, aes
Ram : 526920 / 16437176 : 97
Swap : 0 / 0 : 0
Ram : 97%, Swap : 0% : > 95, 95 ; CRITICAL

its again showing as 97 % , which is not correct( its again including the cache memory in the used memory)

free
total used free shared buff/cache available
Mem: 16437176 11679836 771992 5100 3985348 4413996
Swap: 0 0 0

Note:- I think, in your example also, its showing wrong details.

linux will treat cache memory as used memory and in order to get the application consumed memory:-

We have to get the value in way like

(used memory - available memory)
________________________________ * 100

(Total memory)

But in your example also its not showing correct values.. Please read this.. https://www.linuxatemyram.com/

@dnsmichi
Copy link
Collaborator

Hi,

first off, fill in the issue template and show the exact results from the plugin call. Second, I don't use Nagios, if that's a specific requirement.

If you need help on specific SNMP monitoring tasks, either consult GitHub Enterprise support or pick the right community for your tool (Nagios, Icinga, etc.).

That being said, I don't consider this being a bug.

Cheers,
Michael

@vivuu1989
Copy link
Author

vivuu1989 commented Jun 19, 2019

@DNS already updated the request with requested information. Here the problem is the check_snmp_mem.pl is not showing exact result while looking for the total consumed memory. its showing wrong result

for more details.

The below is the memory consumption information got by "free -h " command

              total        used        free      shared  buff/cache   available
Mem:   16051       11135        1037           5        3879        4581

checked both the ways:

  1. with -m

/check_snmp_mem.pl -H xxxxx --login=xxxxxx --passwd=xxxxx --privpass=xxxxx --protocols=sha,aes -m -w 90,90 -c 95,95 -f

Ram : 93%, Swap : 0% : > 90, 90 ; WARNING | ram_used=15360688;14793458;15615317;0;16437176 swap_used=0;0;0;0;0

I think, here its calculating as

(used+ cache)
__________________ * 100
Total

  1. without -m

/check_snmp_mem.pl -H xxxxx --login=xxxxx --passwd=xxxxx --privpass=xxxxx --protocols=sha,aes -w 90,90 -c 95,95 -f

Ram : 75%, Swap : 0% : ; OK | ram_used=12260732;14793458;15615317;0;16437176 swap_used=0;0;0;0;0

Here its calculation is
(used)
________ * 100
Total

But actually we need :

[ (used)-(cache)]
___________________ * 100
Total

@dnsmichi dnsmichi reopened this Jun 19, 2019
@vivuu1989
Copy link
Author

any suggestion here ?

@dnsmichi
Copy link
Collaborator

You can look into the code and analyse its behaviour. I'm not actively maintaining these plugins anymore, but the Perl code should be fairly readable for adjustments and tests.

@gplazagabriel
Copy link

Hello @vivuu1989 and @dnsmichi . I'm new member here but I recently had the same problem and I solved it changing the check-snmp_mem.pl script. It works with just one output (-m flag is disable right now)

This is the code (you must to change the extension from txt to pl):

check_snmp_mem.txt

I hope it solv your problem.
Regards.-

Gabriel Plaza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants