Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Getting correct port number from process id Post 303042848 by RudiC on Wednesday 8th of January 2020 11:22:51 AM
Old 01-08-2020
Not clear what exactly you want. How far would this get you?
Code:
netstat -anlp | awk -v"PID=$(pgrep jboss)" '$NF !~ PID {next} $(NF-1) == "LISTEN" {n=split ($4, T, "[.:]"); print T[n]} $(NF-2) == "CONNECTED" {print $(NF-1)}'
9990
8080
43013
43029

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

checking invoice number not correct

hello, I have the following script to check the invoice number is in order or not. However, it cannot show out the correct information. My expect output show below and I would like to only list out the NOT IN SEQUENCE inovice number (not included "ok") #!/bin/sh start=1 for file_number in... (8 Replies)
Discussion started by: happyv
8 Replies

2. UNIX for Dummies Questions & Answers

How to find the port number of the oracle process

Hi Unix Gurus, Can we find out the port number used by the oracle process is running.I tried to search the forum but coudnt find. Can anyone help me out with the command (2 Replies)
Discussion started by: thana
2 Replies

3. UNIX for Dummies Questions & Answers

Find what process on port number

Hi, I am on a Sun Solaris and I want to find out which process is allocated on a certain port. How can I do that? BR Andreas (4 Replies)
Discussion started by: mr_andrew
4 Replies

4. Shell Programming and Scripting

Find port number being used by a given process id

Unix gurus, I have a requirement wherein I want to find the port number for a given process id. Is it possible? If so how? TIA, Regards, Praveen (3 Replies)
Discussion started by: sunpraveen
3 Replies

5. Programming

Problem in getting the correct number from the string.

I have string named texts which consist of section label “BOOK-SEC-“. Section starts from 1 to n, where n is a number. For this example conside the value of n is 9. That is, the string variable looks like “BOOK-SEC-1... (2 Replies)
Discussion started by: SamRoj
2 Replies

6. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

7. Shell Programming and Scripting

What is the correct way to process files

Is there a general way I can use so as to process paths/files from your terminal without the need to backslash things? Till recently I used to use touch "file_here" but it does not work if file_here contains any of the characters ` and ", I still need to backslash them if I want to make the... (1 Reply)
Discussion started by: hakermania
1 Replies

8. Solaris

To get process id for port number

Hi All, How to get the list of port numbers and it is correspoding proceses id that are currently running on. Please suggest and it is urgent Thanks. (7 Replies)
Discussion started by: rbalaj16
7 Replies

9. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

10. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
OCF_HEARTBEAT_JBOSS(7)						OCF resource agents					    OCF_HEARTBEAT_JBOSS(7)

NAME
ocf_heartbeat_jboss - Manages a JBoss application server instance SYNOPSIS
jboss [start | stop | status | monitor | meta-data | validate-all] DESCRIPTION
Resource script for Jboss. It manages a Jboss instance as an HA resource. SUPPORTED PARAMETERS
resource_name The name of the resource. Defaults to the name of the resource instance. (optional, string, default default) console A destination of the log of jboss run and shutdown script. (optional, string, no default) shutdown_timeout Timeout for jboss bin/shutdown.sh. We wait for this timeout to expire, then send the TERM and QUIT signals. Finally, the KILL signal is used to terminate the jboss process. You should set the timeout for the stop operation to a value bigger than the sum of the timeout parameters. See also kill_timeout. (optional, integer, default 5) kill_timeout If bin/shutdown.sh doesn't stop the jboss process, then we send it TERM and QUIT signals, intermittently and once a second. After this timeout expires, if the process is still live, we use the KILL signal. See also shutdown_timeout. (optional, integer, default 10) user A user name to start a JBoss. (optional, string, default root) statusurl URL to test in the monitor operation. (optional, string, default http://127.0.0.1:8080) java_home Home directory of Java. Defaults to the environment variable JAVA_HOME. If it is not set, then define this parameter. (optional, string, no default) jboss_home Home directory of Jboss. (required, string, no default) pstring With this string heartbeat matches for the right process to kill. (optional, string, default java -Dprogram.name=run.sh) run_opts Start options to start Jboss with, defaults are from the Jboss-Doku. (optional, string, default -c default -l lpg4j) shutdown_opts Stop options to stop Jboss with. (optional, string, default -s 127.0.0.1:1099) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 60s. stop Stops the resource. Suggested minimum timeout: 120s. status Performs a status check. Suggested minimum timeout: 30s. monitor Performs a detailed status check. Suggested minimum timeout: 30s. Suggested interval: 10s. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5. EXAMPLE
The following is an example configuration for a jboss resource using the crm(8) shell: primitive example_jboss ocf:heartbeat:jboss params jboss_home=string op monitor depth="0" timeout="30s" interval="10s" SEE ALSO
http://www.linux-ha.org/wiki/jboss_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents 1.0.3 07/05/2010 OCF_HEARTBEAT_JBOSS(7)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy