Can I ask the VM for its PID?

19 views
Skip to first unread message

Joachim Tuchel

unread,
Apr 13, 2026, 5:04:37 AMApr 13
to VAST Community Forum
Hi,

I need to understand a few tricky situations in a prduction environment where multiple images are running in parallel.
For this I'd like to add the PID of the running VM to the EsLogManager output.

As a first step I tried to find a way to query the VM for its PID (linux). So far, I haven't found a method that seems to provide this.

And then I'd like to modify EsLogManager / log formatter output to add the PID to the log output - how can I do that?

Joachim

Joachim Tuchel

unread,
Apr 13, 2026, 5:18:59 AMApr 13
to VAST Community Forum
As a little info on why I need this: 

We are starting regular processes in regular intervalls, say every minute, using crontab. Most of the times, such a process does a short job and is done within a few seconds, but it can also take longer.

Sometimes (pattern unknown so far) these processes start to eat up 100% and more cpu, but don't start their actual work. They just keep running at 100.x % CPU usage and thus add load to the machine. 

Sometimes, these processes end after a few or 20 minutes or so, sometimes the don't. This leads to the fact, that every minute, another one starts, and this may or may not just do its job in a few seconds, but sometimes, this new one also eats up 100% cpu and lingers on the machine. 

Over time, this can block all CPUs on the server, which is not such a wonderful result for our users.

So I'd need to see the PID of the blocking processes, so that I can better understand what they are actually doing. So far, they all write to the same log file, so there is a colourful mix of log output from multiple images in one single log file.

Maybe I am just overseeing some other obvious way of getting these logs sorted. 
And yes, I could write a bash scrpt that only starts a new instance of the process if no older one is running. But what if that older one is not doing its job but just loops in whatever endless loop it may be in? The job won't get done...


Joachim

Noschvie

unread,
Apr 13, 2026, 5:28:44 AMApr 13
to VAST Community Forum
Did you have a look to

OSCall>>#getCurrentProcessId

Mariano Martinez Peck

unread,
Apr 13, 2026, 7:33:20 AMApr 13
to va-sma...@googlegroups.com
Hi Joachim,

What about: `OsVastProcess current pid `?

Regards,



--
You received this message because you are subscribed to the Google Groups "VAST Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to va-smalltalk...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/va-smalltalk/999a7008-05d1-41ab-b2c9-3e29b1766c0cn%40googlegroups.com.


--

Mariano Martinez Peck

VAST Lead Consultant

Senior Software Engineer

 mp...@instantiations.com
 @MartinezPeck
 /mariano-martinez-peck
 instantiations.com
TwitterLinkedInVAST Community ForumGitHubYouTubepub.dev

Louis LaBrunda

unread,
Apr 13, 2026, 7:49:43 AMApr 13
to VAST Community Forum
Hi Guys,

I use:

System osProcessId.

It works for both Windows and Linux.

Lou

Joachim Tuchel

unread,
Apr 13, 2026, 7:49:53 AMApr 13
to VAST Community Forum
Hi Norbert,

it took me a moment to find how to use it.

Just formyself to find it again (and maybe others who need it):

PlatformGlobals::OS getCurrentProcessId

Thanks for the pointer!

Joachim

Joachim Tuchel

unread,
Apr 13, 2026, 7:53:31 AMApr 13
to VAST Community Forum
Hi Norbert, Mariano and Lou,


so there is not one way to find the current PID, but at least three:


PlatformGlobals::OS getCurrentProcessId
System osProcessId
OsVastProcess current pid 

They all return tha same result.
That's More than enough ;-)

Thanks a lot to all three of you.

No I need to find a way to add the pid to log messages, preferebly by using a log message  format - I'll have to dig into this.

Joachim
Reply all
Reply to author
Forward
0 new messages