Ad Widget

Collapse

Help required on constructing trigger expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbixfk
    Senior Member
    • Jun 2013
    • 256

    #1

    Help required on constructing trigger expression

    Hello,

    I am trying to construct trigger expression, where i need to obtain allocated and free DHCP ip scope, and if it goes below 20% need to raise alert.Below are item names
    DHCP Free
    Code:
    system.run["C:\\zabbix\\scripts\\dhcpscopefree.bat {#DHCPSCOPE}"]
    DHCP Allocated
    Code:
    system.run["C:\\zabbix\\scripts\\dhcpscopeallocated.bat {#DHCPSCOPE}"]
    Expression on triggerprototype:
    Code:
    (({dhcpScopeTemplate:system.run["C:\\zabbix\\scripts\\dhcpscopefree.bat {#DHCPSCOPE}"].last(0)} * 100)/ 
    ({dhcpScopeTemplate:system.run["C:\\zabbix\\scripts\\dhcpscopeallocated.bat {#DHCPSCOPE}"].last(0)}+{dhcpScopeTemplate:system.run["C:\\zabbix\\scripts\\dhcpscopefree.bat {#DHCPSCOPE}"].last(0)}))<20
    Any pointers are greatly helpful.

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

    #2
    You don't need to include percentage calculation there:
    Code:
    total*0.8<used
    Right site must be constant so equivalent version
    Code:
    used/total>0.8
    In your case total is (DHCP Free + DHCP Allocated), used is DHCP Allocated:
    Code:
    DHCP Allocated/(DHCP Free + DHCP Allocated)>0.8
    What is IMHO equivalent of your trigger expression:
    Code:
    DHCP Free*100/(DHCP Allocated + DHCP Free)<20
    Because:
    Code:
    free*100/total<20
    Equivalent:
    Code:
    free/total<0.2
    Equivalent:
    Code:
    free<0.2*total
    Equivalent:
    Code:
    total*0.8<used
    So where is the problem?
    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

    Working...