Apologies for the late reply - I've been on leave for a couple of days.
When I attempt to verify with the service uncommented in my services.cfg file, I get:
Code: Select all
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Invalid service object directive 'service-description'.
Error: Could not add object property in file '/usr/local/nagios/etc/objects/services.cfg' on line 18.
Error: Invalid max_check_attempts value for host 'MYSERVER2'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/associations.cfg', starting on line 77)
Error processing object config files!
There's nothing wrong with the host definition ("MYSERVER2") that is flagged up, as when the service is commented out in services.cfg, I get no errors at validation, so it MUST be something wrong with the service.
In any case, the service is currently only pointing at one specific host "MYTESTSERVER" (the one that has the NRPE modifications to nsclient.ini), but this isn't the server that gets flagged up in the error message (although both are defined in associations.cfg) so I'm not sure why that's happening. The service doesn't seem to be restricting itself to MYTESTSERVER, but appears to be looking at all the hosts in associations.cfg as well.
Here it is again, just for reference:
Code: Select all
define service{
use generic-service
host_name MYTESTSERVER
check_command NRPE DriveSpace C with Threshold
service-description check_nrpe!check_drivesize! -a drive=C: 'warning=free<5G' 'critical=free<2G' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${free} free / ${size}total}' top-syntax='${status}: ${problem_list}'
}
By the way, line 18, which is referenced in the error message is the "service-description" line within the "define service{}, if that helps.
Incidentally, I CAN run this successfully from the command prompt and it gives me the following:
Code: Select all
OK: {C: 23.173GB free / 39.656GB total}|'C: free'=23.17316G;10;5;0;39.65624 'C: free %'=58%;25;12;0;100
I'm assuming that the "10;5" refers to my warning and critical thresholds, but can't figure out what the 0;39.65624 is there for and how i can eliminate it.
Similarly, i don't understand the "25;12;0;100" at the end of the string, and how I can eliminate THAT - any offers, please?
Cheers
Pete