Running site list

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Running site list

  • Creator
    Topic
  • #47972
    Michael Hertel
    Participant

    I’m going on an endeavour to write our own in-house shut down script

    and would like opinions on the following:

    What would be the best way to get a list of sites on my AIX box that are running?

    When I want to find this out from a command line manually I do this:

    ps -ef |grep lm

    I look for the instances of lock managers with their name that tell me which sites I have going. I don’t want to code it this way if someone

    has a better idea.

    Thoughts?

    -mh

Viewing 2 reply threads
  • Author
    Replies
    • #57204
      Jonathan Hamilton
      Participant

      You could also read the server.ini file and loop through each process in the environments.  You can use the following tcl code to parse it quickly.

      # Create the path to the server.ini file and read the contents.

      set serverFilePath /hci/root3.8.1P/server/server.ini

      if {[catch {set fileIn [read_file -nonewline $serverFilePath]} emsg]} {echo 0; return {}}

      # Start parsing the file contents to find the environs= entry.

      set linesIn [split $fileIn n]

      set environsIndex [lsearch $linesIn *environs*]

      set environsIn [split [lindex $linesIn $environsIndex] “;”]

      regsub -all “environs=” $environsIn “” environsIn

      You could also do as you suggested and ps -ef | grep for the lock manager.  Depends on what else you may do in the script, as to whether or not you want to loop through all of your sites.

    • #57205
      Michael Hertel
      Participant

      That would give me a list of all the sites, but I’m looking only for a quick list of the sites that have something running in them.

    • #57206
      Richard Hart
      Participant

      Our ‘stop all’ script processes all sites that are ‘active’ with Unix shell commands and then requests a stop.  We don’t bother to check if the site is running as the hci ‘stop’ does this for us and we would only be saving a few seconds.

      In our environment, a site is active if a NetConfig file exists – we move the NetConfig file to NetConfig.disabled to make a site inactive.

Viewing 2 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,295
Replies
34,439
Topic Tags
287
Empty Topic Tags
10