Opened 4 years ago
Closed 4 years ago
#320 closed testcase (fixed)
call a Powrshell script
| Reported by: | paetzold@… | Owned by: | |
|---|---|---|---|
| Priority: | 1 | Milestone: | |
| Component: | None | Version: | 0.3.6 |
| Severity: | Patches | Keywords: | |
| Cc: |
Description
Hello,
I think that the example .ini file is wrong.
the line
check_test= cmd /c echo "scripts\ok.ps1" | powershell.exe -command -
have to be changed to
;check_test= cmd /c echo "scripts\ok.ps1;exit($lastexitcode)" | powershell.exe -command -
The reason is, that the servicestate ist alway "warning" and don´t get critical if the script ok.ps1 returns a value of 2.
If the powershell console returns the value to the calling instance than the state gets critical if the scripts returns with value 2.
Thomas Paetzold
Change History (1)
comment:1 Changed 4 years ago by mickem
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.









Did a bit of digging and came up with this:
or in your case:
Seems to work...
Interestingly enough doing exit does NOT work cf:
Then:
Michael Medin