Ad Widget

Collapse

Regex wildcard on web scenario

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcduss59
    Member
    • Jun 2011
    • 33

    #1

    Regex wildcard on web scenario

    Hello everyone!

    I'm a new user of zabbix.
    I created a web scenario on a zabbix 1.8.3 installation and I've got problem with Posix regex wildcard ".*" that do not match.

    I try to monitor a web page which return an html tab with server names columns and other not usefull information in other columns.


    I want to monitor only the servers columns and check if it match a list set in the required parameters.

    My required list looks like it

    .*server1.*server2.*

    It never match with the page to monitor...
    If I only set

    server1
    it will works!!

    If I set
    server1 server2
    it doesn't works too...


    Is the wildcard regex .* not supported?


    The HTML tab should looks like this :
    <table style=" text-align: left; width: 100%;" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <td style="vertical-align: top;">1<br>
    </td>
    <td style="vertical-align: top;">server1<br>
    </td>
    <td style="vertical-align: top;">10<br>
    </td>
    <td style="vertical-align: top;">test<br>
    </td>
    </tr>
    <tr>
    <td style="vertical-align: top;">2<br>
    </td>
    <td style="vertical-align: top;">server2<br>
    </td>
    <td style="vertical-align: top;">15<br>
    </td>
    <td style="vertical-align: top;">test1<br>
    </td>
    </tr>
    <tr>
    <td style="vertical-align: top;">3<br>
    </td>
    <td style="vertical-align: top;">server4<br>
    </td>
    <td style="vertical-align: top;">26<br>
    </td>
    <td style="vertical-align: top;">test2<br>
    </td>
    </tr>
    </tbody>
    </table>



    It doesn't match.

    How to check if server1 and server2 are present in the page checked?

    Thanks for your help.
    Last edited by jcduss59; 21-06-2011, 10:57. Reason: mark as solved
  • jcduss59
    Member
    • Jun 2011
    • 33

    #2
    I also tried this morning in the "Administration -> General -> regular expressions menu" and it doesn't match too...



    According to POSIX extended regular expressions, my regexp may be good and matched?!

    Is it a Zabbix bug?

    Comment

    • jcduss59
      Member
      • Jun 2011
      • 33

      #3
      [solved]

      I solved my problem using this regexp :

      (server1.*$)(\s.*)*(server2.*$)(\s.*)

      Comment

      Working...