How To Know What Middleware Applications Are Running In Your Linux/Unix Environment

Being an Unix based Middleware Administrator, I have to support a heck of an applications in production. Whereas most of the Unix servers contain more than one applications in general. It is hard to identify what applications are running within Unix box, once I log in via putty into the environment until & unless I have the relevant manuals or boring process identification each time.

So being smart I came up with an idea to create a dashboard sort of thing to manage this problem. I am going to share the same with you now.

  1. Login into the corresponding server where you wish to create the dashboard.
  2. Being the administrator, if you are root privileged, go to /root.
    Else you have to go to the default directory (/home/$user) after login with sudo or specific user.
  3. Create a shell script named as ‘Dashboard.sh‘. Now suppose, for this case we know that this Linux box contains Oracle Weblogic server based applications. But the question is what are they and how many of them. So quickly paste the same code in the Dashboard.sh:#!/bin/bash
    #Linux/Unix login dashboardecho ‘Server Name: ‘ $(hostname) 
    echo ‘ ‘
    echo ‘Server Uptime: ‘ $(uptime | awk ‘{print $3,$4,$5}’)
    echo ‘ ‘
    echo ‘Operating System: ‘$(uname -o) 
    echo ‘ ‘
    echo ‘Number of Applications: ‘$(ps -ef | grep java | grep weblogic | awk ‘{print $1}’| sort -u | wc -l)
    echo ‘ ‘
    echo ‘Running Applications:’
    ps -ef | grep java | grep weblogic | grep -v ‘grep’ | awk ‘{print NR,$1}’| sort -u
  4. Save and exit from the shell script. Now is the crucial part. How to see the output at very login into the server. The trick is quite easy. In /root path, you will find a file ‘.bash_profile‘. Add the following line at the very end. Put the necessary path where you jump down after login as any user instead of ‘/root’ by which you are logging in:
     /root/loginScript.sh
  5. You are almost done. Now it is time for a sanity testing round. Logout from the server and log in again. Just after login, you will find the dashboard working as a charm.

    Server Name: TestLinux01
    Server Uptime: 107 days, 20:33
    Operating System: GNU/LINUX
    Number of Applications: 6 

    Running Applications:
    application_1
    2 application_2
    3 application_3
    4 application_4
    5 application_5
    6 application_6

    You can replace the search of ‘weblogic’ with any related middleware application server names like: ‘apache’, ‘tomcat’, ‘jboss’, ‘osb’, ‘jboss’ etc. You can add the following searches in below lines of the script. It will give you a quick view of the running applications in a grouped format quickly at login. It will save a quite a time for every visit, especially when you are in real hurry.

Advertisements

About Swapratim

Blog Writer in Medium for Chatbots Magazine - world's biggest chatbot magazine. Also he writes in Bot Publication and Chatbots Journal on regular basis (https://medium.com/@swapratimroy). Experienced in IT development & support pursuing different roles & responsibilities. He has worked on several innovative projects. Android apps developed by him – In Time SMS, AndroLogic which are freely available in Google Play Store. He has several in house tools built available for free usage on internet. Apart from this, he likes to share his learning with everyone which he had learned over years. Sole purpose of this blog is to share the author's knowledge in IT, passion for travel and recent trends with you. Hope you will enjoy his contents.
Aside | This entry was posted in Various Scripting Tutorials and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s