http://www.perlmonks.org?node_id=1016610


in reply to Remotely Start/Stop Services

What I am looking for is the ability to run the script on my machine and remotely start/stop the services.

To do that, the user id under which you run the program locally will require the permissions to act on the remote machine.

Right now if I put in a hostname in my script I return nothing.

"I return nothing" is a piss poor description. I assume you mean that the attempt fails, but that's a great leap from what you written.

Perhaps you mean something like: "I get nothing returned"?

But even that fails to say what it is you get nothing returned from; what that "it" is, and what it is trying to do;. Even the nature of the "nothing" is important.

Ie. What api are you calling? What are you expecting to get returned from that API if it succeeded? What is the "nothing" you are getting back in failure? eg. 0, '', undef?

HAve you checked $^E after the failure?

To confuse things a bit I am an admin on the servers but I have an admin account for the servers and my user account for my machine.

Again, not a good description. I assume that you mean that you run the program local under your user account even though you have admin accounts on the machines you are trying to control.

As I said above, unless the user ID you use has the appropriate permissions on the remote machine to perform the action requested, it will fail.

You can either:

  1. give your local user id permissions on the remote machines;
  2. or programmically logon onto the remote system and obtain permissions that way.

Win32::IntAuth might help you with the latter.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Remotely Start/Stop Services
by dubl1n (Initiate) on Feb 01, 2013 at 21:24 UTC
    Thanks for the response. My apologies if my descriptions were not correct. Again, I am a beginner trying to grow in my current role. With that said, to respond to your post - I have a user account that I log into my local machine. I also have an admin account that I use to log into our servers. 2 separate accounts. I am trying to run the script on my machine, access the server with my admin credentials and start/stop the services I want. I cannot add my local user to the remote server, that is not an option. My other error where "I get nothing returned" was my error in my script which I have fixed and again, I apologize if I was not more descriptive. I appreciate the suggestion of Win32::IntAuth and see if that could help. Thanks again!