- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to find all running scripts in HPUX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 05:54 AM - last edited on 02-14-2024 08:20 PM by support_s
02-14-2024 05:54 AM - last edited on 02-14-2024 08:20 PM by support_s
How to find all running scripts in HPUX
Hi Everyone,
I am trying to find all the scripts executed on a HPUX B.11.11 system.
Scenario:
This system is new for me, and I am not sure what all scripts are getting executed by different jobs. I would like to monitor and find out all the scripts getting executed on this system.
cron logs are very helpful, where I get the info of all scripts executed by cron.
We have batch jobs and ssh execution from remote systems, need to list them too.
The script names are ending with .sh. I have tried to use ps with different options, but no luck so far. ps outputs give "-sh" only as given below.
Example ouput :
user1 4363 1 0 Jul 25 pts/20 0:00 -sh
root 29023 958 0 10:55:23 ? 0:00 sshd: root@pts/132
user1 20461 1 0 Dec 10 pts/126 0:00 -sh
user2 17797 1 0 Jan 23 pts/68 0:00 -sh
Is there way to find out the script name, for example for PID: 17797 in the above output?
Thanks in advance
- Tags:
- Operating System
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 08:02 AM
02-14-2024 08:02 AM
Re: How to find all running scripts in HPUX
> This system is new for me, [...]
"This system" means HP-UX, or what, exactly? With what are you more
familiar?
> [...] I would like to monitor and find out all the scripts getting
> executed on this system.
Now or ever?
> [...] I have tried to use ps with different options [...]
With my weak psychic powers, "different options" tells me nothing.
"-o args" might provide some useful info.
"ps" tells you what's happening _now_. If you want info on _all_
jobs ever run, then I'd expect an occasional "ps" command to miss many
small/quick jobs.
You might be able to add some job logging to a system-wide shell
start-up file, like, say, "/etc/profile". (Different shells might use
different start-up files. "man <your_shell>" for details?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 01:25 AM
03-04-2024 01:25 AM
Re: How to find all running scripts in HPUX
Thanks @Steven Schweda for the response and apologies for the late reply.
"This system" means the server I was referring to. I was trying to explain I am not familiar with this particular server and the scripts running on it.
> [...] I would like to monitor and find out all the scripts getting
> executed on this system.
Now or ever? - I was planning to write a script to monitor the server for a month, so that, it captures all the *.sh scripts executions.
I have tried to use "ps -o args" in a while loop, hoping that it may capture the process whenever a ".sh" script runs. But as I mentioned, it never displays a scriptname.
As of now, I have decided to collect the available info from cron logs and /etc/profile history.
Thanks and regards
Deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 05:18 AM
03-06-2024 05:18 AM
Re: How to find all running scripts in HPUX
> [...] /etc/profile history.
Note that a C-shell script might not use that file. "man csh", look
for FILES. If you want to catch a C-shell script, then you might need
to look at "/etc/csh.login", too.