Link to home
Start Free TrialLog in
Avatar of Alice7
Alice7

asked on

wmi check via Nagios help please

The command I am using is

./check_nrpe -H xx.x.x.xx -p xxxx -c CheckWMI -a "Query=select Frequency_PerfTime from Win32_PerfRawData_CustomPerformanceTiersCalculator_CustomPerformanceTiersCalculator" "columnSyntax=%Frequency_PerfTime%"

And the output is 2660000000|'wmi query'=1


How do I make it so the output is only 2660000000.  There is other commands I also want to run and do not want |'wmi query'=1 to be a part of the output.


Any suggestions?
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

Is checkWMI a shell, perl or compiled?
Avatar of Alice7
Alice7

ASKER

compiled, i believe, it's part of the check_nt command
If it's compiled, you might be able to find the source and modify it or put that check command in a wrapper that's a non-compiled script to manipulate the response.
Avatar of Alice7

ASKER

Modifying the source is not possible as that will most likely break a lot of checks.

Doing the following I sorta get what I want but it is still not enough

 ./check_nrpe -H xx.x.x.xx -p xxxx -c CheckWMI -a "Query=select Frequency_PerfTime from Win32_PerfRawData_CustomPerformanceTiersCalculator_CustomPerformanceTiersCalculator" "columnSyntax=%Frequency_PerfTime%" | tail --lines=1 | awk '{print $1}'

and the output is 2660000000|'wmi
ASKER CERTIFIED SOLUTION
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial