script to remotely start several applications and instances


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users script to remotely start several applications and instances
# 1  
Old 01-29-2011
script to remotely start several applications and instances

need advise on the ff

a. what would be the best language for script that I can use to create a restart facility of all applications and instances I have on let say more than 20 servers?

b. don't you think its not secure to have a central script residing on one server to remotely create a script to restart remote applications?

c. can you recommend how can this be done w/o sacrificing security? GUI?
# 2  
Old 01-29-2011
You need something like net-snmp or nagios. SNMP is a protocol that is meant to monitor remote systems. SNMP has security built-in. If you are running Oracle, there are Oracle products like datagrid that will do this for you.

I would view creating a script as a poor alternative.

While you could probably write a script, the most straightforward method is to create a single God-like account for the entire set of systems you have. This has negative security implications.
# 3  
Old 01-29-2011
remote start script

A. I would say the scripting language you are most comfortable. And then weight that against what is required to start the apps. Off hand probably combinations of shell,awk,perl.

B. With logic and keeping in mind what these scripts will be doing. I think you can be secure in the process. Tools like ssh,sudo,sudosh with general user / group permissions. But using all these with a clean logic of access and validations.

C. Your choice for the access and control of the scripts. Any user interface can be used to run and execute the scripts as needed. So if you are giving this ability to say your operations support area. Then the access and control could be different than for a group of support UNIX admins.

The how to do it and stay in SOX compliance depends on your environment and what the applications and or instances that you are trying to bounce. If it is a DB environment that would be different and have other support groups and controls that need to be considered like a oracle grid stop / start sql script. Or a web server would maybe need a maintenance page put in place before the service is stopped. Can it be done I would say Yes. Can it be secure, again I would say yes. Has this been done to meet all the security requirements? That would be a yes also.

You don't have to pay for a 3rd party app to do this and then have all the money paid out for support and maintenance. nagios/bigbro/hobbit freeware system monitors / alerting are a start and can send alerts out about problems. But I don't think I would use it to perform the actual bounce of services and applications. But the alert could be sent to a operations support and then they have a procedure that they follow per the alert.

Many services have a auto restart built into them. And the system could do a restart from inittab for services also. That way if a service stops on the server then the OS sees and performs the restart local to the server. No login required and no outside resources needed. You can build smart scripts that the init service would use to bounce a service or application. These methods have been around for years. And if you test and build a script to perform the actions it should not be a problem. Many of the Linux servers have these scripts in the init.d directory. And they are called and used during server stop / start.

Sounds like a challenge and will keep you busy for a month or so. Maybe longer lol...
# 4  
Old 01-30-2011
thanks for all your replies. All my 20servers do have restart script individually. My company would like though to have a central script for our monitoring officer to restart it instead of logging in EACH to the server. is it possible and secure? any recommendation?
# 5  
Old 01-30-2011
Yes it can be done and be secure. I done a couple and basically here was my approach.
1. Create the central users script. If needed the make menu driven. We created a base user not a super user for this account. In out case the home dir is a NFS mount to all the servers. So a script to send commands to another server wasn't needed. A NAS mounted device would work for this also.
2. So since in most cases root needs to be the user to do the work.
I have a local root script that is looping and looking for a file to show up in a defined directory on the global mount. Now this is were it depends on what you are trying to do on the server. So the dropped file
could contain the objective to be bounce. So if you would bounce oracle and refresh sendmail lets say. the file would be named <server name>_???.trg and contain oracle|sendmail. The local script would see the file then consume the file and create a results file.
3. the master script would look for the files to be consumed and the results being created.

There are a lot more steps to all this...

Security wise - since the user login into the server as the service user. They don't know or have ability to be root. That is all controlled by the scripts and your programs. And the service account when it logs in will only run the menu to do your application. And you will also do the trap command in the login control so they can't ctl c or anything out to a shell.

This may sound worse than what the work really is. You could have the whole thing done in a day or so.
# 6  
Old 01-30-2011
Use some great NMS like NetXMS
# 7  
Old 01-31-2011
Are yo running Oracle (you mentioned instances)? It doesn't matter though. There have been many, many posts about 'remote commands' and 'central administration'.

My approach, which I'm surprised wasn't mentioned, is a wrapper for ssh.

If you can ssh to all your servers, then you can write a wrapper (or loop) to connect to all the servers and run a command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Display status of instances in apache - Where to start

Hello, I know this is not a simple question so I just need to know where to start for below project: I am running under Ubuntu 18.04 What I'd like to see in apache page is to display status of particular process pids. ps aux | grep keywords.txt keywords.txt word1 word2 word3 word4... (9 Replies)
Discussion started by: baris35
9 Replies

2. Solaris

How to remotely start ssh on Solaris?

Hi everyone, I have a Solaris machine: SunOS 5.10 Generic_127127-11 sun4v sparc SUNW,SPARC-Enterprise-T5220 After reboot, I can't ssh to this machine. Error message: ssh: connect to host xxxx port 22: Connection refused It seems ssh daemon is not running, but I don't have... (5 Replies)
Discussion started by: Zaiwen Gong
5 Replies

3. Shell Programming and Scripting

How to run multiple instances of shell script in linux?

How we can run the multiple instances of the script? I need to run the script which I am calling from the below function.I can doit with cron but I don't want to put it in the cron.This cript dploy the build and here I want when the build stage then it should run with multilpe instances of... (6 Replies)
Discussion started by: anuragpgtgerman
6 Replies

4. UNIX for Advanced & Expert Users

script to remotely start an application instance

just wanted to ask if anybody have script template for the subject above so I can make ti as my guide? example a. server 1.1.1.1: restart script located at /etc/init.d/glassfish.sh b. server 2.2.2.2: central script that support admin will use to execute to restart the /etc/init.d/glassfish.sh... (0 Replies)
Discussion started by: lhareigh890
0 Replies

5. Shell Programming and Scripting

Want to have delay in multiple instances of the same shell script

Hello, My goal is to run the same Shell script in a parallel mode. This script will get triggered from different machines and different application teams by some job scheduling tool. They may trigger the process at the same time. so I want to have them in QUEUE ..and release them for execution on... (3 Replies)
Discussion started by: chetan_sonar
3 Replies

6. Shell Programming and Scripting

Get the STATE of the weblogic instances via shell script.

Can I get the STATE(instance are RUNNING or not and HEALTH is OK or not) of the weblogic instances(Admin and Managed) running on my unix machine via shell script. Someone told me that it can be done via "weblogic.Admin GETSTATE"....but it is not working for me(might be I am doing something wrong)... (2 Replies)
Discussion started by: joshilalit2004
2 Replies

7. Shell Programming and Scripting

Multiple instances of the job in shell script.

Hi, Please let us know how to create a multiple instances of a job in the shell script. Thanks. Gangegowda K.G (1 Reply)
Discussion started by: Gangegowda
1 Replies

8. Shell Programming and Scripting

Script that checks for previous instances running

Hello, I'm trying to write a script that checks for previous instances of the same script which may still be running (this script is scheduled to run every 30 minutes). I want to somehow use the pid from each instance to make sure the previous one isn't running before continuing with my... (5 Replies)
Discussion started by: bd_joy
5 Replies

9. UNIX for Advanced & Expert Users

reg no of instances of a script run using cron

I have the below code in a file called test.ksh and it is scheduled using cron forevery 5 min. when i see the cron out file for every 5 min it showing the no of process running are 2. same thing when i implement in another script which contains other code along with the below code , it showing as... (1 Reply)
Discussion started by: kamesh83
1 Replies

10. Shell Programming and Scripting

How to limit the number of running instances of a script?

I would like to allow only one instance of a script to run at any moment. I've tried the following solution to count the instances but the result is always the number of running instances plus one and I can't find the problem ps -ef | grep $0 | sed '/^$/ d' | sed '/grep/ d' | wc -l Please... (2 Replies)
Discussion started by: oti
2 Replies
Login or Register to Ask a Question