We are monitoring OS components like CPU,Disk and Memory through EPAgent. Once CPU is high then I have to check which PID is consuming more CPU and some time need to check the PIDs in historical data also if necessary.
We are having EPAgent on around 30 Solaris/Linux servers. I am getting around 40000 of metrics from TopCPU. Script contains command "ps -eo 'user,pcpu,rss,pid,comm' | sort -k 2 -nr | head -10". Whenever I am running given command on console it is providing only Top 10 PIDs.
PFA the script and let me know what I have to change so that we can see only top metrics and can avoid other metrics. Example SS is also attached.
Let me know if you need more information from me.
What version of the EPAgent do you have? This does not appear to be an out of the box script. Can you let us know where the script came from?
This script is very old and really do not know from where it came from.
EPAgent version is 9.5.2. I am running this script from Introscope file.
Script is running every 5 minutes.
Thanks & Regards
Senior Consultant for APM
On Aug 10, 2016 21:02, "musma03" <email@example.com>
Also how are you running this from the IntroscopeEPAgent.properties file? How often are you running it?
I have tried running this in my environment and not seeing a lot of metrics.
Can you expand the screenshot and show us how all of the pid's are showing up rather than just the top 10?
Ok I think I found out why you are getting more than 10 metrics.
It is because the top 10 are not constant. I watched my system and ran a few different processes and I noticed the # of metrics climbing. I also set this to run every minute to force metrics quicker.
It is indeed showing you the top 10, however if you start Program A and A breaks into that top 10, that would be the 11th metric shown in the Investigator, displacing one of the others as a top 10. Also if you expand some of the folders (perl for example, you will see different pid's showing up. So while the perl process is the same one, under perl you may see pid1234, pid1235, etc.... for each new one that shows up.
So this custom script would need to be tweaked to prevent this from happening.
I would recommend contacting Professional Services for help on this.
Matt has provided an explanation of the script behavior and a next step (Use Professional Services or rewrite script) Do you have any followup questions for Matt? Or was the answer sufficient and may we mark this thread as answered?
Please let us know
I have marked this part as answered and branched off the follow-up questions