Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Can we use shell scripts to identify Unix processes using discovery patterns ?

AS001102941
Tera Contributor
 
2 REPLIES 2

VivekSattanatha
Mega Sage

Hi , The 'Unix - Application Dependency Mapping' probe already discovering all the running process. What exactly you want to do?

Renat Akhmedov
Tera Guru

Hi @AS001102941,

Yes, you can use shell scripts in "Discovery Patterns" to identify Unix processes - but you should be careful and don't forget to follow best practices, as:


1. Use standard Unix utilities (ps -ef, netstat, lsof, etc.) in short, controlled commands.

2. Parse the result in the pattern using operations (parse table, regex, extract parameters, etc.).

3. If logic gets complex, move it into a "Script Include" and call it from the sensor/pattern step, rather than putting everything into the shell script itself.


If you have any specific questions, please ask them here as well.


If my answer was helpful, please don’t hesitate to give it a thumbs-up - it only takes a second, but it means a lot to me. Thank you!


Best regards,
Renat Akhmedov