script help needed
Posted: Wed Aug 04, 2021 1:15 pm
I am using check_nrpe to run a script/batch file to return a registry value.
The values that is possible to be returned can be 4 different values
Values:
0x0
0x1
0x2
0x3
My goal is when the values 0x0,0x2, and 0x3 is present it should be at critical state, 0x1 should be ok state. i also want to add a message to the critical alert for example 0x0 = critical state the message i want to add is "host is in disabled mode" or is it easier to add this to my returned value?
here is my current script.
@echo off
for /F "tokens=3" %%A in ('reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\swin\Parameters" /v "RTEMode"') DO (ECHO %%A)
exit 0
any help is appreciated.
The values that is possible to be returned can be 4 different values
Values:
0x0
0x1
0x2
0x3
My goal is when the values 0x0,0x2, and 0x3 is present it should be at critical state, 0x1 should be ok state. i also want to add a message to the critical alert for example 0x0 = critical state the message i want to add is "host is in disabled mode" or is it easier to add this to my returned value?
here is my current script.
@echo off
for /F "tokens=3" %%A in ('reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\swin\Parameters" /v "RTEMode"') DO (ECHO %%A)
exit 0
any help is appreciated.