Problems adding D drive into monitoring


#1

I did some searches of the forum for help with this and given the number of threads on this subject I hesitate to ask it again. Sadly none of the suggested fixes have worked for me so I’m asking.

I have added the service definition into my cfg file to check the disk usage on my d: drive but the cfg file check errors out on the service description line of the definition. If I comment out the service_description line the cfg files check comes back with no errors but the drive still doesn’t show up in monitoring. My C: and E: drives are working correctly and the syntax is the same for all 3 with the exceptions of the drive letters. Can anyone help me with this? Here are the lines from my cfg file.

define service{
        use                     generic-service
        host_name               blue
        service_description     C:\ Drive Space
       check_command CheckAllDrives!25%!50%
        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }

define service{
        use                     generic-service
        host_name               blue
        service-description     D:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l d -w 80 -c 90
        }


define service{
        use                     generic-service
        host_name               blue
        service_description     E:\ Drive Space
        check_command           check_nt!USEDDISKSPACE!-l e -w 80 -c 90
        }

I’ve tried commenting out the CheckAllDrives line for the c: drive service thinking that may have been the problem. Nothing changed.

This is what I get form the config file check

Error: Invalid service object directive 'service-description'.
Error: Could not add object property in file '/usr/local/nagios/etc/objects/blue.cfg' on line 126.

Line 126 is the service description line for drive d:. Any suggestions or ideas would be great.


#2

Hi!

I’m not sure, but I ALWAYS try to avoid special characters in my cfg files => so, could you try to remove the “:” of the service description ?

I’m pretty sure your error comes from that :slight_smile:


#3

The syntax for the c drive is directly from the default windows.cfg file. I only changed the host_name. I tried what you suggested anyway but I still get the same results from the cfg file check. Any more ideas? Thanks for the fast reply.


#4

[blockquote]the syntax is the same for all 3 with the exceptions of the drive letters[/blockquote] Nope…
[blockquote]Error: Invalid service object directive ‘service-description’. [/blockquote]
spot the difference…

        service_description     C:\ Drive Space 
        service-description     D:\ Drive Space 

Hint: It’s between “service” and “description”

HTH

/S


#5

GAH!!! I hate it when it’s something stupid like that. Thanks for proof reading for me !lol