How to execute vbscripts with icinga agent

Hi,
I would like to monitor a print spooler on my windows printserver. I would like to get an alarm if too many print jobs stuck in the spooler for too long.

for this I discovered an vbscript for Nagios and NSClient.: Monitoring/Printer/check_print_spooler.vbs at master · riskersen/Monitoring · GitHub
original its designed to be executed with NSClient.
We only use Icinga for Windows to monitor our windows servers.
Introduction - Icinga for Windows

Sometimes i read posts, icinga for windows can execute vbs and Powershell scripts. I would like to run check_print_spooler.vbs with the icinga agent. I can’t find a manual how to execute scripts with icinga agent.

Does anyone have a manual/docs for this? Please send me a link.
thanks for your help.

Best regards
Chris

TLDR: same as on Linux

You just use the script as check command.
If you have set the check command path in the config you can use the name of the script else just use the full path. If the Windows shell isn’t detecting how to execute the script then add the interpreter in front of the command.

Hi Dominik,
thank’s for your replay.
Okay your explanation sounds similar, like I did this in the past, in NRPE.
But I think, I have to work in a different way with Icinga Agent, compared to the other agents(NSClient,Nrpe), but I don’t know why.
I didn’t arrange the icinga agent setup in the past. I am a newbie to Icinga Agent. I don’t know the syntax or how to set this up in icinga director. I would like to get into it.

In the director, you first need a command.
I use my own variables in the command definition and add fields for them.
Then you create a service template utilizing the command.
Finally create a service in a service-set, service apply rule or directly on a host.

Hi,
thanks, i will reverse engineer the existing commands/services and definitions and try to build one with this in mind.