LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell script to find running services, installed applications/programs and ports. (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-to-find-running-services-installed-applications-programs-and-ports-4175523580/)

snowman83 10-28-2014 10:10 AM

Shell script to find running services, installed applications/programs and ports.
 
Hello Folks,

I am looking for a shell script which would provide me with following output:- Running services on a linux host, installed applications/programs, install location and the ports on which they are running.

I am using Red Hat Linux.

Can someone please help me out with this script? Its very urgent and we need to use it on a production server.

Regards.

snowman83 10-28-2014 10:23 AM

Shell script to find out all connected hosts.
 
Hello Folks,

One of my friend works on a Red Hat linux box. He is looking for a shell script which can provide me with all hosts which connected to that particular linux box (using ssh), date and time of connection, mode of connection, port etc.
Basically a script which can give all information on who has been talking to that linux box for past few months.

Can anyone please help with such a shell script? Its very urgent and they intend to use the same on their production server. Please confirm.

Regards.

Soadyheid 10-28-2014 10:46 AM

Have you tried asking Red Hat? If you're using it in a production environment you're surely paying them for support?

I'd reckon not doing so is an unacceptable risk to your customers should you have some sort of catastrophic failure.

Perhaps you should be running Centos, the "free" equivalent instead.

Be lucky, you may need it!

:hattip:

netnix99 10-28-2014 11:26 AM

I don't know that you really need a script for that. I would personally just check out the log files.

/var/log/secure - shows remote connections, type of connection, username, date, time

and if you run the command:
Code:


last | more

You can see who all has been logged in, for how long, if they are still logged in, dates/time for the logins, and IP/hostname of originating connection.

If you are needing to create reports with this data, you can use simple commands (grep, sed, awk, etc.) to grab the data and redirect to a file.


HTH

vipinsqa 10-28-2014 10:10 PM

Hi,

Thanks for the revert. Actually, we do not have any support available from RedHat. I just need a script so that I can run it on the server (one of them is a production server) and get the information on running services, installed applications/programs, install location and ports etc.
Please help me with a script which provides me with these kind of details.

Regards.

vipinsqa 10-28-2014 10:16 PM

Hi,

Thanks for the revert. Actually, we do not have any support available from RedHat. I just need a script so that I can run it on the server (one of them is a production server) and get the information on running services, installed applications/programs, install location and ports etc.
Please help me with a script which provides me with these kind of details.

Regards.

vipinsqa 10-28-2014 10:30 PM

Hi,

Thanks for the revert.
I need the information on all hosts which connected to the linux box:- Their IP address (hostname), date/time of connection, type of connection, username etc.
Is it possible to get all this information in /var/log/secure? I can see and realise that the secure log generally breaks down after a limit, so how can I retrieve entries from this log and which column represents which field?

Would appreciate if someone can help me with a script.

Regards.

pan64 10-29-2014 01:47 AM

duplicate of http://www.linuxquestions.org/questi...ox-4175523546/

chrism01 10-29-2014 02:19 AM

We'd like to see what you've written so far, but you could start with the netstat cmd...

AnanthaP 10-29-2014 02:21 AM

http://www.tldp.org/LDP/Linux-Filesy.../html/var.html

would be a place to start.

OK

eklavya 10-29-2014 04:37 AM

Run the command :
Code:

last | grep "still"
Edit:
I haven't posted my answer here. Actually this is not the same question either.
It was about find logged in users.

pan64 10-29-2014 06:23 AM

I do not think you can use any general solution, because there is no general solution to this issue. There are a lot of different services with different (strange?) configurations and there can be a lot of local customizations, specialized daemons ....
rpm -q can be used to check officially installed packages, but there can be other apps too.

Tinkster 10-29-2014 04:42 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. I took the liberty to merge the two next to identical threads.


All times are GMT -5. The time now is 09:44 PM.