NRPE: Command 'check_mem' not defined
NRPE: Command 'check_mem' not defined
Hello Team,
We have one AIX server (10.144.223.174) on which we need to monitor physical memory. I have searched regarding the same and got to know about a plugin "check_mem.pl".
I have downloaded this plugin on our Nagios XI server (10.144.223.156):
-rwxr-xr-x 1 apache nagios 15013 Jun 18 06:18 check_mem.pl
On remote host, I have edited the nrpe.cfg file and added the command as below:
command[check_mem]=/usr/local/nagios/libexec/check_mem -f -w 20 -c 10
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$
While trying to test the command from NAgios server command line, getting the below error:
[nagios@eu1papu003 libexec]$ /usr/local/nagios/libexec/check_nrpe -H 10.144.223.174 -c check_mem
NRPE: Command 'check_mem' not defined
[nagios@eu1papu003 libexec]$
Kindly, look into the issue and help us on the same.
We have one AIX server (10.144.223.174) on which we need to monitor physical memory. I have searched regarding the same and got to know about a plugin "check_mem.pl".
I have downloaded this plugin on our Nagios XI server (10.144.223.156):
-rwxr-xr-x 1 apache nagios 15013 Jun 18 06:18 check_mem.pl
On remote host, I have edited the nrpe.cfg file and added the command as below:
command[check_mem]=/usr/local/nagios/libexec/check_mem -f -w 20 -c 10
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$
While trying to test the command from NAgios server command line, getting the below error:
[nagios@eu1papu003 libexec]$ /usr/local/nagios/libexec/check_nrpe -H 10.144.223.174 -c check_mem
NRPE: Command 'check_mem' not defined
[nagios@eu1papu003 libexec]$
Kindly, look into the issue and help us on the same.
Thanks & Regards,
I2MP Team.
I2MP Team.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
2 possible problems, first your command is defined like this
but your filename is check_mem.pl, I would change the command to
2nd, you need to make sure you restart the nrpe service after making changes to the nrpe.cfg
Code: Select all
command[check_mem]=/usr/local/nagios/libexec/check_mem -f -w 20 -c 10Code: Select all
command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10Re: NRPE: Command 'check_mem' not defined
Hello,
I changed the command as below:
command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10
After that I restarted nrpe and ran the check command, getting other error now as below:
[nagios@eu1papu003 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.144.223.174 -c check_mem
NRPE: Unable to read output
I changed the command as below:
command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10
After that I restarted nrpe and ran the check command, getting other error now as below:
[nagios@eu1papu003 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.144.223.174 -c check_mem
NRPE: Unable to read output
Thanks & Regards,
I2MP Team.
I2MP Team.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRPE: Command 'check_mem' not defined
What do you get if you run the following on the remote server
Code: Select all
su nagios -c "/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10"Re: NRPE: Command 'check_mem' not defined
Hello,
Below is the output:
PRODUCTION> nagios@eu1pdwu094: /usr/local/nagios/libexec > su nagios -c "/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10"
nagios's Password:
Memory CRITICAL - 0.0% (0 kB) free
PRODUCTION> nagios@eu1pdwu094: /usr/local/nagios/libexec >
Below is the output:
PRODUCTION> nagios@eu1pdwu094: /usr/local/nagios/libexec > su nagios -c "/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10"
nagios's Password:
Memory CRITICAL - 0.0% (0 kB) free
PRODUCTION> nagios@eu1pdwu094: /usr/local/nagios/libexec >
Thanks & Regards,
I2MP Team.
I2MP Team.
Re: NRPE: Command 'check_mem' not defined
Can you run the following command as nagios user (and as root) on the AIX box, and show the output?
As far as I can tell, this is what is used by the plugin:
Code: Select all
/usr/bin/vmstat -vCode: Select all
...
elsif ( $uname =~ /AIX/ ) {
my @meminfo = `/usr/bin/vmstat -v`;
foreach (@meminfo) {
chomp;
if (/^\s*([0-9.]+)\s+(.*)/) {
my $counter_name = $2;
if ($counter_name eq 'memory pages') {
$total_memory_kb = $1*4;
}
if ($counter_name eq 'free pages') {
$free_memory_kb = $1*4;
}
if ($counter_name eq 'file pages') {
$caches_kb = $1*4;
}
}
}
$used_memory_kb = $total_memory_kb - $free_memory_kb;
}
...Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE: Command 'check_mem' not defined
Hi,
Below is the output:
PRODUCTION> nagios@eu1pdwu094: /home/nagios > /usr/bin/vmstat -v
12582912 memory pages
12120032 lruable pages
1376342 free pages
3 memory pools
2644264 pinned pages
90.0 maxpin percentage
3.0 minperm percentage
90.0 maxperm percentage
24.3 numperm percentage
2953153 file pages
0.0 compressed percentage
0 compressed pages
24.3 numclient percentage
90.0 maxclient percentage
2953153 client pages
0 remote pageouts scheduled
11533088 pending disk I/Os blocked with no pbuf
0 paging space I/Os blocked with no psbuf
2228 filesystem I/Os blocked with no fsbuf
131 client filesystem I/Os blocked with no fsbuf
63937017 external pager filesystem I/Os blocked with no fsbuf
65.6 percentage of memory used for computational pages
PRODUCTION> nagios@eu1pdwu094: /home/nagios >
I dont have root access to the server.
Below is the output:
PRODUCTION> nagios@eu1pdwu094: /home/nagios > /usr/bin/vmstat -v
12582912 memory pages
12120032 lruable pages
1376342 free pages
3 memory pools
2644264 pinned pages
90.0 maxpin percentage
3.0 minperm percentage
90.0 maxperm percentage
24.3 numperm percentage
2953153 file pages
0.0 compressed percentage
0 compressed pages
24.3 numclient percentage
90.0 maxclient percentage
2953153 client pages
0 remote pageouts scheduled
11533088 pending disk I/Os blocked with no pbuf
0 paging space I/Os blocked with no psbuf
2228 filesystem I/Os blocked with no fsbuf
131 client filesystem I/Os blocked with no fsbuf
63937017 external pager filesystem I/Os blocked with no fsbuf
65.6 percentage of memory used for computational pages
PRODUCTION> nagios@eu1pdwu094: /home/nagios >
I dont have root access to the server.
Thanks & Regards,
I2MP Team.
I2MP Team.
Re: NRPE: Command 'check_mem' not defined
Can you also show the output of the following command?
Code: Select all
vmstat | tail -1 | awk '{print $4,$5}'Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE: Command 'check_mem' not defined
Hello,
Below is the output:
PRODUCTION> nagios@eu1pdwu094: /usr/bin > vmstat | tail -1 | awk '{print $4,$5}'
2388404 0
PRODUCTION> nagios@eu1pdwu094: /usr/bin >
Below is the output:
PRODUCTION> nagios@eu1pdwu094: /usr/bin > vmstat | tail -1 | awk '{print $4,$5}'
2388404 0
PRODUCTION> nagios@eu1pdwu094: /usr/bin >
Thanks & Regards,
I2MP Team.
I2MP Team.
Re: NRPE: Command 'check_mem' not defined
We don't have access to an AIX server so we cannot test the plugin to see if it functions.
What version of AIX is the server running?
Can you run the plugin as root like the following example to see if it works?
There are a few versions of that plugin, can you provide a link to where you found it?
What version of AIX is the server running?
Can you run the plugin as root like the following example to see if it works?
Code: Select all
/usr/local/nagios/libexec/check_mem.pl -f -w 20 -c 10Be sure to check out our Knowledgebase for helpful articles and solutions!