Closed kafos closed 2 months ago
i cannot reproduce this, which snclient version is this?
It's version 0.25 here some screenshots:
so it does work now?
the value count is 2 and based on "top-syntax=%(status) - %(count) - {{ IF %(count) < 1 }} NO VNC PROCESS RUNNING {{ ELSIF %(count) > 1 }} RUNNING SESSION {{ END }}" the output should be "WARNING - 2 - RUNNING SESSION"
Seems that "IF %(count) < 1" gives TRUE back but it's FALSE.
could you try {{ IF count < 1 }}
the %() are not required in the if expression
same with: "top-syntax=%(status) - %(count) - {{ IF count < 1 }} NO VNC PROCESS RUNNING {{ ELSIF count > 1 }} RUNNING SESSION {{ END }}"
finally found the issue, thanks for reporting this. Should be fine with the next release.
I tried the template syntax with a check_process of VNC processes but it seems that the conditioning does not work properly:
command: check_nsc_web -k -p "PASSWORD" -u https://IP:PORT \ check_process process=tvnserver.exe warn="state=stoppped || count > 1 || count < 1" \ ok-syntax="%(status) - VNC running" 'empty-state=3' \ 'top-syntax=%(status) - %(count) - {{ IF count > 1 }} "active VNC session" {{ ELSIF count < 1 }} "VNC OK" {{ END }}'
the output looks like this: WARNING - 2 - "active VNC session" "VNC OK" |'count'=2;1:1;;0; 'rss'=77619200B;;;0; 'virtual'=9033150464B;;;0; 'cpu'=28.791498%;;;0;
documentation says: {{ IF }}...{{ ELSIF }}...{{ ELSE }}...{{ END }}
"ELSIF" correct? -- anyway -tried with ELSEIF or ELIF - dont' get the correct output.
Tried it also with {{ IF %(count) > 1 }} "active VNC session" {{ ELSIF %(count) < 1 }}