Running script whenever user hits resources limits

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kennethmaze
    Junior Member
    Forum Explorer
    • Mar 2021
    • 26

    #1

    Running script whenever user hits resources limits

    I was wondering if there would be a way to run a script whenever a user hits the resources limits
  • john
    Junior Member
    • Sep 2017
    • 4

    #2
    Hello!

    I was wondering if theres anyway i can run a script or command line like top -u Username > report.txt whenever a user hits the resources limits?

    Comment

    • bogdan.sh
      Administrator
      • Nov 2016
      • 1221

      #3
      Hi,

      There is no way to trigger anything when user hits a limit. You can run a cronjob to trace if there are any faults with lveinfo --by-faults=any then run script/command however it will not be the same as you want as it will be post factum , ~1 minute after an issue happened.

      Comment

      • john
        Junior Member
        • Sep 2017
        • 4

        #4
        My primary objective is to trace what processes are making the users hit the resources limit. Ive notice that lve-stats2 now has the option to list the processes. I was wondering if this will give me access to the list of processes that were running at the time the user hit the limit.

        Comment

        • bogdan.sh
          Administrator
          • Nov 2016
          • 1221

          #5
          Actually yes, you are right. The snapshots were implemented to lvestats2 specially for this case, to get a list of processes when users hits limits.

          Comment

          • john
            Junior Member
            • Sep 2017
            • 4

            #6
            Ive check the lve-stats2 is it not possible to had a more complex process list? All i get is a pid and the process like "php" or "http", was wondering if theres a way of us getting the full script running like top displays when you do a top -c.

            Comment

            • bogdan.sh
              Administrator
              • Nov 2016
              • 1221

              #7
              Nice suggestion, let me pass this to our developers, we will see if possible to do it.

              Comment

              Working...