check_wmic inconsistancy

2 posts / 0 new
Last post
brian@haberstroh.com
Offline
Last seen: 9 years 8 months ago
Joined: 18.07.2013 - 17:17
check_wmic inconsistancy

I am using check_wmic to check several things on remote machines and I am gettin incinsustan results. I have machines that have both C and D drives. But when I check somtimes I can only get results for the C drive, other machines I get results for only the D drive. What I dont understand, If I have results for 1 drive why do I get "Unknown -no observations"..... here are the 2 services and the command:

 

 define service{
    use generic-service
    hostgroup_name         parser_machines,dbservers
    service_description     Disk C
    check_command             wmic_local_disk_free!C!--warn 250 --crit 100
 }

 define service{
  use generic-service
     hostgroup_name         parser_machines
  service_description Disk D
  check_command wmic_local_disk_free!D!--warn 250 --crit 100
 }

# 'wmic_local_disk_free' command definition
#
define command{
    command_name    wmic_local_disk_free
    command_line    $USER1$/check_wmic --host $HOSTADDRESS$ --user $HOSTNAME$\\$USER10$ --password $USER11$ --alias "LogicalDisk where DeviceID='$ARG1$:'" --property FreeSpace --factor 0.0000009536743 --compare lt --format "Free disk space on $ARG1$: %.2f MB|'Free $ARG1$:'=%.2fMB" $ARG2$
}

 

BTW, this is YOUR default command for checking drive space with 1 exception,  I have added the --compare lt because I did not want be be warned when I have 3gb of drive space, argh! not sure who though that up, lol.

Also, I KNOW for a FACT that all machines in this group have both C and D drives.

 

One other note. I am checking remote machines that are NOT part of a domain, but all have mirror administrator privladged accounts (hense the $HOSTNAME$\\$USER10$). I do nto have a permissions problem or I woudl NEVER get a response for EITHER drive.

 

I also have another check command that fails on some of these machines even when I get a response for drive space. LOL, I can get a responce for the C drive,  unknow for the D drive and A sucessfull process count. some machine I can get good C/D check and fail the proces count. I have sone DB servers and I can check their services, but not drive space... WHY????

 

define command{
    command_name wmic_non_running_exe
    command_line $USER1$/check_wmic --host $HOSTADDRESS$ --user $HOSTNAME$\\$USER10$ --password $USER11$ --alias "Process where (Name='$ARG1$')" --property Name --count --compare lt --format "%d program running." $ARG2$
}

 

 

 

 

itefix
Offline
Last seen: 3 days 6 hours ago
Joined: 01.05.2008 - 21:33
Try to specify the user name

Try to specify the user name in quotes (and password as well if it contains special chareacters):

command_line    $USER1$/check_wmic --host $HOSTADDRESS$ --user '$HOSTNAME$\\$USER10$' --password '$USER11$' --alias "LogicalDisk where DeviceID='$ARG1$:'" --property FreeSpace --factor 0.0000009536743 --compare lt --format "Free disk space on $ARG1$: %.2f MB|'Free $ARG1$:'=%.2fMB" $ARG2$

You can also try to specify quotes as a part of user variables $USER10$ and $USER11$

Release news