Ad Widget

Collapse

Tracking or registering process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nibb
    Member
    • Oct 2008
    • 78

    #1

    Tracking or registering process

    Hi I was wondering if there is the chance not only to monitor with Zabbix but also save data or somehow track things down.

    I have a specific server which get each day on the same time or between a specific time a very high load. I cannot seem to find what is causing this but the server has 4 processor and the load is always at 0.50 and then 1 hour at a day it goes to 14 and basically slows down and hangs. Zabbix sends the alerts that there is a high load. It seems this is not a 1 process that is taking the hit on the CPUs but a few small ones because Zabbix also sends alerts that there are to much process running.

    Im not sure if its apache or email. When i log in after some minutes the load is fine again and i cannot seems to know what happened. Unless i start to do a top on this hours, for 3 hours each day im not going to get the issue. I have to track it right then when it happens. So Zabbix tells me what is wrong but I want to know if there is a way to actually store data so I can log into Zabbix and actually see what happened. Maybe store a top command, im not sure if there is a log that registeres how many process with their names.
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    See if you can get the following code wrapped into a remote script and tied to a trigger:

    ps aux | sort -rnk3 | head -10 > /tmp/topcpu.`date +%Y%m%d%H%M%S`

    this will print the top 10 processors by CPU percentage and put them into a text file with the time appended in the format of YYYYMMDDHHmmSS in the tmp directory.

    Hopefully that will give you a fighting chance, otherwise you could run this command every few minutes and then use Zabbix to know what file to look at. If you choose this method put the files in a separate directory (unless tmp is non-volatile) and have it self purge files older than say 24 hours.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • nibb
      Member
      • Oct 2008
      • 78

      #3
      Thats actually a very good idea. Since the load comes and goes so fast on certain boxes, it could save the top data on the file so i can look it later more closely to see what is happening in more detail.

      I will try it right away. Thanks

      Comment

      Working...