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_CustomPe rformanceT iersCalcul ator_Custo mPerforman ceTiersCal culator" "columnSyntax=%Frequency_P erfTime%"
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?
./check_nrpe -H xx.x.x.xx -p xxxx -c CheckWMI -a "Query=select Frequency_PerfTime from Win32_PerfRawData_CustomPe
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?
Is checkWMI a shell, perl or compiled?
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.
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_CustomPe rformanceT iersCalcul ator_Custo mPerforman ceTiersCal culator" "columnSyntax=%Frequency_P erfTime%" | tail --lines=1 | awk '{print $1}'
and the output is 2660000000|'wmi
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_CustomPe
and the output is 2660000000|'wmi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.