Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18980

rename "required string" to "required pattern" in web checks

    XMLWordPrintable

    Details

      Description

      Update by zabbix support:
      **********************
      after comment from Glebs Ivanovskis below conclusion is that in frontend, in web check settings, field name "required string" is misleading, as it's actually regexp.
      Suggested to rename it in a way that it will be clean that it's a regexp, for example "required pattern"
      Issue summary updated accordingly.
      *********************

      Steps to reproduce:

      1. Create a web scenario step (for the Jenkins login page)
      2. add the "required string" of "<title>Sign in [Jenkins]</title>"

      Result:
      See log excerpt:

       19188:20210205:142224.442 process_httptest() use step "GET login page"
       19188:20210205:142224.442 process_httptest() use post ""
       19188:20210205:142224.442 process_httptest() go to URL "https://jenkins.example.com/login"
       19188:20210205:142224.470 process_httptest() page.data from https://jenkins.example.com/login:'
          
          
        
        
        <!DOCTYPE html><html lang="en-US"><head resURL="/static/9547cc1b" data-rooturl="" data-resurl="/static/9547cc1b" data
      -imagesurl="/static/9547cc1b/images"><title>Sign in [Jenkins]</title><meta name="ROBOTS" content="NOFOLLOW"><meta name=
      "viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/static/9547cc1b/css/simple-page.
      css" type="text/css"><link rel="stylesheet" href="/static/9547cc1b/css/simple-page.theme.css" type="text/css"><link rel
      ="stylesheet" href="/static/9547cc1b/css/simple-page-forms.css" type="text/css"></head><body><div class="simple-page" r
      ole="main"><div class="modal login"><div id="loginIntroDefault"><div class="logo"></div><h1>Welcome to Jenkins!</h1></d
      iv><form method="post" name="login" action="j_acegi_security_check"><div class="formRow"><input autocorrect="off" autoc
      omplete="off" name="j_username" id="j_username" placeholder="Username" type="text" class="normal" autocapitalize="off" 
      aria-label="Username"></div><div class="formRow"><input name="j_password" placeholder="Password" type="password" class=
      "normal" aria-label="Password"></div><input name="from" type="hidden"><div class="submit formRow"><input name="Submit" 
      type="submit" value="Sign in" class="submit-button primary "></div><script type="text/javascript">
                        document.getElementById('j_username').focus();
                        var checkBoxClick = function(event) {
                          document.getElementById('remember_me').click();
                        }
                      </script></form><div class="footer"></div></div></div></body></html>'
       19188:20210205:142224.471 In int_in_list() list:'200' value:200
       19188:20210205:142224.471 End of int_in_list():SUCCEED
       19188:20210205:142224.471 In process_step_data() rspcode:200 time:0.027836 speed:59222.000000
       19188:20210205:142224.471 query [txnlev:0] [select type,itemid from httpstepitem where httpstepid=16]
       19188:20210205:142224.474 In zbx_preprocess_item_value()
       19188:20210205:142224.474 End of zbx_preprocess_item_value()
       19188:20210205:142224.474 In zbx_preprocess_item_value()
       19188:20210205:142224.474 End of zbx_preprocess_item_value()
       19188:20210205:142224.475 In zbx_preprocess_item_value()
       19188:20210205:142224.475 End of zbx_preprocess_item_value()
       19188:20210205:142224.475 End of process_step_data()
       19188:20210205:142224.478 query without transaction detected
       19188:20210205:142224.478 query [txnlev:0] [update httptest set nextcheck=1612531404 where httptestid=16]
       19188:20210205:142224.483 cannot process step "GET login page" of web scenario "Jenkins (internal)" on host "monitoring.example.com": required pattern "<title>Sign in [Jenkins]</title>" was not found on https://jenkins.example.com/login
      

      Expected:
      I expect that required string to be found as visible in the log and therefor the check to be successful.

      I checked with a diff (just to make sure) but the required string is definitely in there.
      In the log excerpt above are line feeds because I copied it from the console. The original source of the page looks as follows:

          
          
        
        
        <!DOCTYPE html><html lang="en-US"><head resURL="/static/9547cc1b" data-rooturl="" data-resurl="/static/9547cc1b" data-imagesurl="/static/9547cc1b/images"><title>Sign in [Jenkins]</title><meta name="ROBOTS" content="NOFOLLOW"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/static/9547cc1b/css/simple-page.css" type="text/css"><link rel="stylesheet" href="/static/9547cc1b/css/simple-page.theme.css" type="text/css"><link rel="stylesheet" href="/static/9547cc1b/css/simple-page-forms.css" type="text/css"></head><body><div class="simple-page" role="main"><div class="modal login"><div id="loginIntroDefault"><div class="logo"></div><h1>Welcome to Jenkins!</h1></div><form method="post" name="login" action="j_acegi_security_check"><div class="formRow"><input autocorrect="off" autocomplete="off" name="j_username" id="j_username" placeholder="Username" type="text" class="normal" autocapitalize="off" aria-label="Username"></div><div class="formRow"><input name="j_password" placeholder="Password" type="password" class="normal" aria-label="Password"></div><input name="from" type="hidden"><div class="submit formRow"><input name="Submit" type="submit" value="Sign in" class="submit-button primary "></div><script type="text/javascript">
                        document.getElementById('j_username').focus();
                        var checkBoxClick = function(event) {
                          document.getElementById('remember_me').click();
                        }
                      </script></form><div class="footer"></div></div></div></body></html>
      
      

        Attachments

          Activity

            People

            Assignee:
            zabbix.dev Zabbix Development Team
            Reporter:
            derdeagle Johannes M√ľnch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: