AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  Aix commands

    Posted Mon September 13, 2010 11:49 AM

    Originally posted by: Selvasubramanian


    Hi

    I want to write a script for finding the status of services details of my remote server.so i have to write a script on my application server which will contact the remote server.It has to send mail to us, if the services in the remote server went down .

    Can anyone help me on this?.

    Regards,
    Selva
    #AIX-Forum


  • 2.  Re: Aix commands

    Posted Thu September 16, 2010 01:02 AM

    Originally posted by: BruceSpencer


    Try the dsh command. It requires a .rhosts or ssh file. See "man"

    The command syntax is straight forward:

    dsh "script" > mail
    The "script" can be a command or shell script. You can distribute the script using the "dcp" command.
    #AIX-Forum


  • 3.  Re: Aix commands

    Posted Thu September 16, 2010 01:13 AM

    Originally posted by: SystemAdmin


    There would be a few challenges with this one:

    1. How often do you want the remote server to be polled?
    2. Will the actual code reside on the remote server or app server?
    3. The mail id is local or external?
    4. If external do the servers have capability to forward the mail to the local mail gateway/internet mail gateway....firewall considerations.

    Have you tried using ODM based error notification? Sorry do not have the link to it at the moment, but it has a neat functionality to monitor particular services and take action (send mail in this case) if the service went down.

    r/
    R
    #AIX-Forum


  • 4.  Re: Aix commands

    Posted Thu September 16, 2010 09:41 AM

    Originally posted by: BruceSpencer


    The "dsh" would run on the central server. It runs "command" the remote servers (see man page for setup). The results from each server are displayed on STDOUT on the central server. The STDOUT is mailed to whoever you want.

    1. How often do you want the remote server to be polled?
    This is your choice. I would use a cron job.

    2. Will the actual code reside on the remote server or app server?
    The "command" can be any AIX command or a shell script located on the remote servers
    example dsh "prtconf" (this returns the configuration of each remote host)
    dsh "/usr/local/bin/mycommands" (this runs a shell script residing on the remote hosts)

    3. The mail id is local or external?
    This is just the mail command. I left off the mail command details to keep it simple. You could use "mail -x anybody@yourorganization.com"
    4. If external do the servers have capability to forward the mail to the local mail gateway/internet mail gateway....firewall considerations.
    N/A
    I've tried ODM Error Notification. It works. A simpler approach is to use error notification in the AIX "websm" tool. It will set it up for you.
    #AIX-Forum