Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Remotely Start/Stop Services

by BrowserUk (Pope)
on Feb 01, 2013 at 20:32 UTC ( #1016610=note: print w/replies, xml ) Need Help??

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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016610]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-02-23 17:32 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (350 votes). Check out past polls.