Ad Widget

Collapse

User macros in Web monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DavisNT
    Junior Member
    • Feb 2014
    • 2

    #1

    User macros in Web monitoring

    How to correctly use user macros (defined for Web monitoring scenario) in Required string?
    I have tried defining user macro in Variables of Web scenario like this
    Code:
    {macro1}=teststring
    and reference it by setting Required string of Step of scenario to
    Code:
    {macro1}
    . In result I got Error: required pattern not found when executing that step.

    When trying to define user macro in Variables of Web scenario like this
    Code:
    {macro1}=regex:teststring
    I got message Error: error in scenario variables during execution of first step of scenario.
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    Which version of Zabbix do you use?
    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

    • DavisNT
      Junior Member
      • Feb 2014
      • 2

      #3
      I am using latest (2.2.2) version of Zabbix.

      Comment

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

        #4
        Ref:



        You should to know 2 terms:
        1.) variable
        is step-level variable (used term macro of web scenario used in manual is not the best term) related only to web steps.
        You can define it in Variables, but I didn't find in manual or source that these variables can be used in Required string

        2.) macro
        is global available constant.
        You can define your macro in Configuration -> General -> Macros
        e.g {$MACRO1} => teststring

        6 Supported since Zabbix 2.2.0. The HOST.* macros and the user-defined {$MACRO} are supported in the web scenario Name and Variables fields and in the scenario step Name, URL, Post and Required string fields. {$MACRO} is also supported in the web scenario Authentication (user and password) and Agent fields, and in the scenario step Required status codes field.
        Now you can use your {$MACRO1} in Required string in definition of your step of Web monitoring.

        So create macro (not variable) and your problem should be solved :-)
        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...