So today i've been setting up my nagios server and client to monitor their physical memory, I'm using a linux nagios box and a windows server 2012 with NSClient++
So i've went into my nsclient.ini and changed this;
Code: Select all
; Section for NRPE (NRPEServer.dll) (check_nrpe) protocol options.
[/settings/NRPE/server]
; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = true
Code: Select all
; alias_mem - Alias for alias_mem. To configure this item add a section called: /settings/external scripts/alias/alias_mem
alias_mem = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page
(and restarted the nsclient service)
I also defined my command in my commands.cfg
Code: Select all
# 'check_mem' command definition
define command{
command_name check_mem
command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckMEM -a MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=physical
}
Code: Select all
define service{
use generic-service
host_name SEY-ERP03,SEY-ERP02
service_description Physical Memory Usage
check_command check_mem!85!95
}
Code: Select all
[root@SEY-NAGIOS objects]# /usr/lib64/nagios/plugins/check_nrpe -H SEY-ERP03 -p 5666 -c CheckMEM -a MaxWarn=80 MaxCrit=90 ShowAll type=physical
CRITICAL: physical memory: Total: 16G - Used: 11.5G (71%) - Free: 4.55G (29%) > critical|'physical memory %'=71%;99;99 'physical memory'=12298706944B;80;90;0;17179398144
[root@SEY-NAGIOS objects]# echo $?
2
Any help would be greatly appreciated
EDIT: some extra information this is what I can read from the webui :
Code: Select all
Current Status: CRITICAL (for 0d 1h 6m 46s)
Status Information: CRITICAL: physical memory: Total: 16G - Used: 11.5G (71%) - Free: 4.49G (29%) > critical
Performance Data: 'physical memory %'=71%;100;99 'physical memory'=12360978432B;0;90;0;17179398144
Current Attempt: 3/3 (HARD state)
Last Check Time: 01-23-2017 16:37:56
Check Type: ACTIVE
Check Latency / Duration: 0,000 / 0,000 seconds
Next Scheduled Check: 01-23-2017 16:47:56
Last State Change: 01-23-2017 15:38:53
Last Notification: 01-23-2017 15:42:53 (notification 1)
Is This Service Flapping? NO (5,00% state change)
In Scheduled Downtime? NO
Last Update: 01-23-2017 16:45:36 ( 0d 0h 0m 3s ago)