Ad Widget

Collapse

Need Help: Trigger for CPU Utilization under 10%

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • delija91p
    Junior Member
    • Nov 2014
    • 24

    #1

    Need Help: Trigger for CPU Utilization under 10%

    Hey there you guys,

    I was just wondering if anyone would by chance know how I could create a trigger, that would let the administrators know if a certain server's CPU Util was under 10 percent?

    So far I have created a new template just for this, since I want to automatically assign to new servers. Then I added the item key: system.cpu.util[,idle,avg1]
    Also I added this in the trigger section: {Template CPU Usage:system.cpu.util[,idle,avg1].last()} < 10

    I am not sure if this would exactly work or if there is possibly a better way to do this? Thanks for the help in advance, I really appreciate it!
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    Code:
    {Template CPU Usage:system.cpu.util[,idle,avg1].last()} < 10
    = go to problem state if average idle cpu usage of last minute is less then 10%
    = go to problem state if average nonidle (system+user+iowait+....) usage is more then 90%

    If your really want the trigger for CPU Utilization under 10%:
    Code:
    {Template CPU Usage:system.cpu.util[,idle,avg1].last()} > 90
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    • delija91p
      Junior Member
      • Nov 2014
      • 24

      #3
      Thank You so Much!

      Thank you so much for the help! Sorry, its been a long time since I have replied, but I appreciate it! I have been struggling to get my head wrapped around this trigger for a long time now.

      Comment

      • delija91p
        Junior Member
        • Nov 2014
        • 24

        #4
        Could you possibly help me with the same for a Windows Machine?

        That is another thing that I have been working on, and for some reason I can not wrap my head around it... But how would this be possible with a Windows Machine? Cause as far as I know this trigger would not be able to monitor a server with Windows on it.

        Comment

        • jan.garaj
          Senior Member
          Zabbix Certified Specialist
          • Jan 2010
          • 506

          #5
          What did you try and which items are available for WIN?
          Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
          My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

          Comment

          • tchjts1
            Senior Member
            • May 2008
            • 1605

            #6
            For Windows, you will more than likely want to use an item from the native Windows PerfMon counters. On my Win servers, I have 2 items I could use for this:

            perf_counter[\Processor(_Total)\% Idle Time,60]

            or

            perf_counter[\Processor(_Total)\% Processor Time,60]

            I choose to use the latter, with this trigger set at the Windows template level to tell me any Win server that has CPU usage of 100% for 5 minutes or more:

            Code:
            {Template OS Windows:perf_counter[\Processor(_Total)\% Processor Time,60].avg(300)}>99
            So if you wanted to alert on only one specific server where CPU usage is less than 10%, you would use that second item above, and use this trigger, created at the host level.
            Code:
            {ServerNameHere:perf_counter[\Processor(_Total)\% Processor Time,60].last()}<10

            Comment

            • delija91p
              Junior Member
              • Nov 2014
              • 24

              #7
              Thank You Guys so Much

              I honestly really have to thank you guys, this was extremely helpful, and once I start adding more servers, I will let you know how it is working! I have been trying to figure this out for a long time, and I finally gave in to post here. Thank you guys again! I really appreciate it!

              Comment

              • delija91p
                Junior Member
                • Nov 2014
                • 24

                #8
                These triggers, after 7 days

                Hey you guys, I just had a quick question, the triggers you guys have helped me with work fantastically, now I just need to make a slight modification and I can't seem to get it to work. So I want this trigger to only trigger after a week, to notify me of which servers are being under utilized that week. With these triggers, I was getting constantly spammed which wasn't exactly what I was looking for. I feel like there is an adjustment I simply need to make in the trigger expression but I could be wrong.

                Comment

                • tchjts1
                  Senior Member
                  • May 2008
                  • 1605

                  #9
                  Originally posted by tchjts1

                  Code:
                  {Template OS Windows:perf_counter[\Processor(_Total)\% Processor Time,60].avg(300)}>99
                  As in my example a few messages up in this thread you see the above trigger that I use. That alerts me if CPU usage is 100% for 5 minutes (300 seconds).

                  7 days in seconds is 604800 so you could use that, or I believe you can simply make it "human readable" and put "7d".

                  So if you want to be alerted on servers that have an average of less than 10% over a 7 day period, I think you can do this:

                  Code:
                  {Template OS Windows:perf_counter[\Processor(_Total)\% Processor Time,60].avg(7d)}<10
                  There might be other (better) ways of doing it, but that is how I would do it.

                  EDIT - I will leave my response here, but now that I think about it, I don't believe my trigger above will work the way you are hoping for - to get an alert every 7 days. Maybe Jan will have the right answer for you as he is very good with triggers.
                  Last edited by tchjts1; 20-04-2015, 23:16.

                  Comment

                  • jan.garaj
                    Senior Member
                    Zabbix Certified Specialist
                    • Jan 2010
                    • 506

                    #10
                    Code:
                    .avg(7d)}<10
                    I agree it's the trigger for week.
                    note: it's not calendar week, but a week from now()-7 days.
                    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
                    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

                    Comment

                    • ingus.vilnis
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Mar 2014
                      • 908

                      #11
                      Hi,

                      Just my two cents here so that you are aware what impact this may have on your Zabbix system.

                      Time based functions like avg, min, max etc, requires all evaluated item values to be stored in Zabbix Value cache. In your scenario with avg(7d) you are going to store 7 days of collected item values for all your servers in Zabbix Value Cache. That means 10080 values per each server will be stored in memory. Please check Zabbix cache usage graph on your Zabbix server and make sure you have configured ValueCacheSize parameter in your zabbix_server.conf file accordingly.

                      And make sure you don't run out of RAM on your server because of this.

                      Best Regards,
                      Ingus

                      Comment

                      • delija91p
                        Junior Member
                        • Nov 2014
                        • 24

                        #12
                        Thank you all for the responses... I am slowly getting to what I want. So the reason I want to setup a trigger for servers with less than 10 percent utilization over a week is because I simply want to get an email notification after a week has passed with a list of servers that are being underutilized.. Is there anything you guys can think of to do this in a better way?

                        Thank you so much in advance!

                        Comment

                        • delija91p
                          Junior Member
                          • Nov 2014
                          • 24

                          #13
                          Ping

                          Hey you guys,

                          I was wondering if anyone thought of anything better, to do what I want as said above... I have been tweaking and working with it everyday bit by bit, but I am still stuck and confused on how I should approach this problem.
                          Any ideas and help is appreciated!

                          Thank you guys so much in advance!

                          Comment

                          Working...