I am writing a windows batch to get the cpu utilization and check for condition is value is greater than 80. if cpu util greater than 80 , i should get a mail.
Could you please help. i use wmic cpu get "LoadPercentage" | find /V "LoadPercentage"
You would need to use a 3rd party app to send an email, you could use blat, then the rest of the batch would look like this
for /f %%a in ('wmic cpu get "LoadPercentage" ^| find /V "LoadPercentage"') do (
set p=%%a
goto :BREAK
)
:BREAK
if %p% geq 80 blat -params
You would need to replace the -params with blat's actual arguments, which you can find here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With