How to monitor Linux physical memory on Icinga2

Hi

I am searching how to monitor Linux physical memory on Icinga2 .

I don`t see any plugin for physical memory check and uptime plugin for Linux .

For windows, I am using NSClient++ ,it is fine.

The plugin isn’t included, but there’s a template for it.

See this here: https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#mem

as well, here’s the link for the plugin itself:

You’ll want to throw that in your default monitoring plugins folder, wherever that is.

I can also suggest Percona’s plugin. Inside their database tool plugin repo there is also a plugin for Nagios/Icinga that checks memory. See here

/George

Hi
Blake

nice to meet you!

I have tested this script.Not working .

Can u tell me how it is working ?

Thanks

What exactly is not working?
Please describe what you did and what the outcome of running the script is.

To “install” the script:

  • download from github
  • chmod 755 the script
  • ./check_mem.pl --help to see all command line options
  • run the scripts with you desired options
  • maybe install some missing perl libs
1 Like

Hi log1c

It is working in terminal .

Please see the photo.

The output clearly states that the check_mem.pl plugin is not found in the /usr/lib64/nagios/plugins directory.
So either the plugin really does not exist there, or the permissions and/or file ownership settings are wrong.

Running the plugin as root will always work. What happens if you run it as the user running icinga (typically nagios on Debian/Ubuntu systems and icinga on CentOS/RHEL)

1 Like

This might be an issue with the permissions. Please also share the output of pwd and ls -l /usr/lib64/nagios/plugins/check_mem.pl.

Edit: (basically redundant to what @log1c said. We were posting at the same time. :sweat_smile:)

1 Like

@arshe Are you using RHEL or CentOS and is SELinux enabled?

1 Like

CentOS bro

SELinux is enforcing bro .

permission ??

@log1c @winem

I already given 777 permissions on that check_mem.pl.

CentOS 7.6
SELinux Enforcing .

Edit:

@log1c @winem @acolvinPID

I got it bro

thanks all. image

:+1: What was the final solution? In case some else stumbles across the problem, they will be happy to find a solution.

1 Like