[Official Thread] Script Processor support thread

Ask and answer questions related to any type of OSA scripting.
Message
Author
AlexSG
Posts: 47
Joined: Sat Dec 03, 2011 7:18 pm

Re: [Official Thread] Script Processor support thread

#11 Post by AlexSG » Sat Dec 10, 2011 8:58 pm

jschuryk wrote:Hmmm - I don't mind being stupid...but I hate doing stupid things.

Apparently using the correct syntax works :) Thanks.
It took me a little time to get used to also.

Question regarding scripts. Lets say I wanted to get a little more fancy. Right now I an running a couple of Named scripts. One runs WOL and the other PSShutdown on a test PC. State Images work on the GUI now also. *Man this is fun stuff.* So now I would like to try and get PSShutdown to reboot a file server which is easy enough. But what if I wanted state images that changed as the server came online. Could you use something like the ping command?

Restart server.
Image state shows:On
Label shows:Shutting Down
Pinging hostname with reply.

Ping timeout.
Image state shows:Off
Lable might say something like:Offline

Ping reply.
Image state shows:On
Lable shows:Restarting.

Not sure about this yet but maybe to take image and label out of restaring state and show fully online you may have to have it try and initiate and RDP SYN, and when it gets ACK maybe reset connection and change state on GUI. Or SMB. Just something that will not initiate unless server is up.

User avatar
bwoodworth
Site Admin
Posts: 1563
Joined: Tue May 04, 2010 6:49 am
Location: California

Re: [Official Thread] Script Processor support thread

#12 Post by bwoodworth » Sun Dec 11, 2011 12:34 am

Sounds like you can probably use the Network Monitor plugin for what you want. It basically pings all objects of type 'Network Device' and 'Computer' and sets their state based on if they are online or not.
Brian

AlexSG
Posts: 47
Joined: Sat Dec 03, 2011 7:18 pm

Re: [Official Thread] Script Processor support thread

#13 Post by AlexSG » Sun Dec 11, 2011 1:10 am

Okay, nice. I will look into that.

Script question again.

Should running Speech-TALUS.Run Method.Play."C:\OSA\Sounds\sound.wav" play the sound file? I can execute command with serivce and media player comes up. But I cannot just play it.

Thanks.

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: [Official Thread] Script Processor support thread

#14 Post by Vaughn » Sun Dec 11, 2011 3:16 am

AlexSG wrote: Should running Speech-TALUS.Run Method.Play."C:\OSA\Sounds\sound.wav" play the sound file? I can execute command with serivce and media player comes up. But I cannot just play it.

My older clients did, but honestly have not used the audio files in a long time, there could be path issues or something. I will look at it tomorrow. I am about done with script changes and some GUI changes I have been working on. Just have to add Update to the Named Scripts screen so you can rename scripts...

Vaughn

AlexSG
Posts: 47
Joined: Sat Dec 03, 2011 7:18 pm

Re: [Official Thread] Script Processor support thread

#15 Post by AlexSG » Sun Dec 11, 2011 12:20 pm

Okay cool Vaughn. When ever you have time to check the play feature out. Let me know what you come up with.

Brian, Network Monitor is a nice feature. Just tested it. Works with FQDN also. I will see what I can do with it.

I wonder if there is a way to have OSA detect when a new device is connected to the network and broadcasts its presence. That would be a useful feature Might have to be some sort of plugin. Or maybe a plugin that scans the network to keep dynamic inventory of what devices are connected..

User avatar
bwoodworth
Site Admin
Posts: 1563
Joined: Tue May 04, 2010 6:49 am
Location: California

Re: [Official Thread] Script Processor support thread

#16 Post by bwoodworth » Sun Dec 11, 2011 2:28 pm

There is no way for it to know when any device is added to the network. It may be possible to detect devices that are uPnp compatible or something like that. Something to consider.
Brian

MaffeMuis
Posts: 10
Joined: Mon Dec 30, 2013 2:57 pm

Re: [Official Thread] Script Processor support thread

#17 Post by MaffeMuis » Sun Jan 12, 2014 8:54 am

I have a strange problem with Script Processor

The SET STATE is not working for me. After some test I fount out its something with the code of Script Processor and not my code.
I did the following test:

I need to do This:
nick.Set State.Here.Here

Do a dubble Here otherwise it's not take the code. I think it's something with the sParam1

The log with 1 here:
01-12-2014 05:52:23.792 - 1: (0) - Set State: nick

The log with 2x here.here:
01-12-2014 05:52:23.792 - 2: (0) - Set State: nick.Here

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: [Official Thread] Script Processor support thread

#18 Post by Automate » Sun Jan 12, 2014 10:18 am

Thanks for reporting. I'm seeing the same thing. I have created an Issue here https://github.com/opensourceautomation ... issues/206

Hopefully Vaughn can take a look into this.

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: [Official Thread] Script Processor support thread

#19 Post by Vaughn » Sun Jan 12, 2014 11:56 am

I just fixed it. Will commit it to Git in a few minutes. It was just grabbing the wrong parameter.

I never noticed it because I always call the method and have it set the state. But a test script confirmed it real quick.

Vaughn

automan
Posts: 16
Joined: Sat Aug 30, 2014 1:18 am

Re: [Official Thread] Script Processor support thread

#20 Post by automan » Fri Sep 05, 2014 6:38 am

Hi there, I am hoping a generous soul can tell me what I am doing wrong? On 4.3 (Web Server 0.4.8) my scripts (Processor 4.0) are not being created when I click "Add", or changing when i update (existing scripts). I have checked the DB and they are not in there either. Should I revert to a previous version - and if so...of which plugin!

Any ideas?

Post Reply