Hi,

first let me say that PRTG is one of the best piece of software I've the last years. It is genius.

But now to my problem. We run PRTG on several servers and monitor a lot of things right now. More to come. On my client I have installed it just for testing out new things. I run the newest canary version 17.4.36.3471 on a Win 7 client.

I wrote a powershell script to check a file and it works fine. For some security reasons I compiled the script with PS2EXE-GUI and it also works fine on the command line. It accepts 4 parameters and gives back "0:ok" or "1:failed" just like I wanted it to. On the web interface I fail because I cannot set another "Primary channel" except the two ones that are always there.

What's the difference between .ps1 and .exe concerning this? What must my script/program have to take influence on this setting? What's my mistake?

Thank you in advance for some hints

cyberclaus62


Article Comments

Hi cyberclaus62,

Thank you for the compliments :)

I'm not fully sure what you mean by 'On the web interface I fail because I cannot set another "Primary channel" except the two ones that are always there.'

When using sensor type "EXE/Script", this one only has two channels, one for the returned value and the other one displayin the execution time, it will never have more. If you require the sensor to show more channels, then you need sensor type "EXE/Script Advanced", but the returned output needs to be different then, for example: <prtg> <result> <channel>First channel</channel> <value>10</value> </result> <result> <channel>Second channel</channel> <value>20</value> </result> </prtg> You also find more about this in PRTG (Setup | PRTG API | Custom Sensors).

Kind regards,

Erhard


Nov, 2017 - Permalink

Hi Erhard,

thank you for your reply.

OK, now I see the difference between running the .ps1-Script and the .exe-program. On the command line they work equal. In PRTG implementing the ps1 (as a sensor) I have the chance to manually add a channel. Using the exe.program I don't have this chance. Therefore I can only use the two channels "Ausführungsdauer" and "Ausfallzeit" in the German version.

It seems I have to take the pill and use the .ps1-script.

Thank you very much

Best regards
cyberclaus


Dec, 2017 - Permalink