This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to run a perl script on the local solarwinds server?

I have installed cygwin perl on our primary orion server. I want to assign application component monitors to run scripts in perl. My hope is to be able to convert these over from a linux server. Im running these scripts to mointor external rss feeds and complex url checks that require more than what SAM HTTP or WPM can do.

I tried the unix/linux script. I tired using the windows script and using PerlScript instead of vbscript; but that dosnt work. Im almost tempted to install an ssh server so the unix/linix script with work through ssh.

Thanks!

Kurt

  • What errors are you running into? Are you able to run the script manually using csh cscript?

  • If you successfully install ActivePerl and Perl is registered as an script engine, the same script should work for you using Windows script monitor.

    E.g. when running as "cscript /E:PerlScript mycript.pl".

    Usually the issues are in providing input/output parameters.

    Can you provide more details mainly how do you run the script, which monitor do you use?

  • Sorry for not posting the error. It looks like I need to register PerlScript. I started reading the doc's but haven't figured out how to yet.

    CScript Error: Can't find script engine "PerlScript" for script "C:\ProgramData\SolarWinds\Orion\temp\a85f7cee-f6f4-402f-a7ce-6a20827eebf6".

    Output: ==============================================

    CScript Error: Can't find script engine "PerlScript" for script "C:\ProgramData\SolarWinds\Orion\temp\a85f7cee-f6f4-402f-a7ce-6a20827eebf6".

  • Oh, I see. I have to use Activestate perl. I haven't tried this one yet.

  • I still get the same error after installing Activestate Perl. Does it require a reboot?

    Strait from cmd line:

    C:\scripts>C:\Perl64\bin\perl.exe digitalsmiths_prod-elb.pl

    Message.status: OK: queryId: a82502673cbc0c5 hitcount: 0 hits:

    Statistic.status: 0

    When trying through csscript:

    C:\>cscript C:\scripts\digitalsmiths_prod-elb.pl

    Microsoft (R) Windows Script Host Version 5.8

    Copyright (C) Microsoft Corporation. All rights reserved.

    Input Error: There is no script engine for file extension ".pl".

  • Do I have to buy prod activestate perl in order to run perl scripts through SAM windows script?

  • Perl executed on the Orion server has to execute through the Windows Script interpreter "cscript.exe". If you don't specify the script type in the file you will need to specify it in the command line. E.G. "cscript /engine:Perlscript myscript.pl". The equivalent of this switch in SAM is the "Script Engine" option in the Windows Script Monitor.

    Script Engine.png

  • I have it set up. It crashes when run through csscript.exe on 2008. I am so on the verge of tossing solarwinds out. The instructions on setting this up is so vague and non existent. I'd rather stick with a Linux based enterprise monitoring tool.

  • Are you able to attach your script to this thread?

    Also, you are running a 64 bit version of Perl. So, you will need to make sure you run the monitor in 64-bit mode

    SAM-Platform-Setting.gif

  • I tried the basic script on other posts to rule out my script with same result:

    Script:

    print "Message.Value1: Hello World!\n";

    print "Statistic.Value1: 1.0\n";

    print "Message.Value2: This is the message for Value2\n";

    print "Statistic.Value2: 2.0\n";

    exit 0;

    output local:

    C:\>perl C:/scripts/test.pl

    Message.Value1: Hello World!

    Statistic.Value1: 1.0

    Message.Value2: This is the message for Value2

    Statistic.Value2: 2.0

    Run through csscript.exe:

    pastedImage_0.png

    error:

    Faulting application name: cscript.exe, version: 5.8.7601.18283, time stamp: 0x5258a6f2

    Faulting module name: PerlSE.dll, version: 5.18.0.1800, time stamp: 0x54455381

    Exception code: 0xc0000005

    Fault offset: 0x0000000000009c6c

    Faulting process id: 0x1524

    Faulting application start time: 0x01d0682907fffca9

    Faulting application path: C:\Windows\system32\cscript.exe

    Faulting module path: C:\Perl64\bin\PerlSE.dll

    Report Id: 45aeeadb-d41c-11e4-9744-005056ab8a1e