Hi,
I am trying to understand how do I use the arguments in SAM scripts when writing a Windows Script Monitor in python so that I can get the node IP/Name, username and password passed into the script?
I have tried adding the arguments to the arguments field at the top with it inside the script, inside the script without in the arguments field, as "python {SCRIPT} arg1 arg2 ar3" in arguments field with also in the script and other variations but I can't get it working.
Any suggestions?
Any help would be much appreciated, thanks.
Solved! Go to Solution.
Solved this one myself today 😄 Here is how you do it if anyone else is having the same issue.
Nothing needed in the arguments field at the top.
In the script you can have the argument as '${arg}'. You must have the single quotes around the argument.
So for example:
user = '${USER}'
password = '${PASSWORD}'
node = '${IP}'
This should hopefully fix your issues too as this one was bugging me for a long time.
Solved this one myself today 😄 Here is how you do it if anyone else is having the same issue.
Nothing needed in the arguments field at the top.
In the script you can have the argument as '${arg}'. You must have the single quotes around the argument.
So for example:
user = '${USER}'
password = '${PASSWORD}'
node = '${IP}'
This should hopefully fix your issues too as this one was bugging me for a long time.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.