Forum Discussion

pablo_juarez's avatar
pablo_juarez
Icon for Altostratus rankAltostratus
Aug 06, 2025
Solved

HTTP Monitor to Check USER-COUNT from Ivanti Node – Regex Issues

Hi everyone,

I'm trying to configure an HTTP health monitor on an F5 LTM to check a value returned by an external Ivanti (Pulse Secure) node. The goal is to parse the value of the USER-COUNT field from the HTML response and ensure it's below or equal to 3000 users (based on our license limit). If the value exceeds that threshold, the monitor should mark the node as DOWN.

The Ivanti node returns a page that looks like this:

<!DOCTYPE html ... >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Cluster HealthCheck</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h1>Health check details:</h1>
CPU-UTILIZATION=1;
<br>SWAP-UTILIZATION=0;
<br>DISK-UTILIZATION=24;
<br>SSL-CONNECTION-COUNT=1;
<br>PLATFORM-LIMIT=25000;
<br>MAXIMUM-LICENSED-USER-COUNT=0;
<br>USER-COUNT=200;
<br>MAX-LICENSED-USERS-REACHED=NO;
<br>CLUSTER-NAME=CARU-LAB;
<br>VPN-TUNNEL-COUNT=0;
<br>
</body>
</html>

I’m trying to match the USER-COUNT value using the recv string in the monitor, like this:

recv "USER-COUNT=([0-9]{1,3}|[1-2][0-9]{3}|3000);"

I’ve also tried many others.

The issue is: even when the page returns USER-COUNT=5000;, the monitor still reports the node as UP, when it should be DOWN. The regex seems to match incorrectly.

What I need:
A working recv regex that matches USER-COUNT values from 0 to 3000 (inclusive), but fails if the value exceeds that limit.

Has anyone successfully implemented this kind of monitor with a numeric threshold check using recv? Is there a reliable pattern that avoids partial matches within larger numbers?

Thanks in advance for any insight or working example

  • Hi pablo_juarez​ 

    I think it's because it matches also <br>MAXIMUM-LICENSED-USER-COUNT=0;

    could you try
    recv "<br>USER-COUNT=([0-9]{1,3}|[1-2][0-9]{3}|3000);"

7 Replies

  • It looks like it is related to all html page. Checking this answer, monitor is always up with this pattern USER-COUNT\=([0-9]{1,3}|[1-5][0-9]{3}|6000);:

    <head>
    <title>Cluster HealthCheck</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
    <body>
    <h1>Health check details:</h1>
    CPU-UTILIZATION=1;
    <br>SWAP-UTILIZATION=0;
    <br>DISK-UTILIZATION=24;
    <br>SSL-CONNECTION-COUNT=1;
    <br>PLATFORM-LIMIT=25000;
    <br>MAXIMUM-LICENSED-USER-COUNT=0;
    <br>USER-COUNT=7265;
    <br>MAX-LICENSED-USERS-REACHED=NO;
    <br>CLUSTER-NAME=CARU-LAB;
    <br>VPN-TUNNEL-COUNT=0;
    <br>
    </body>

     

    On the other hand, I created a simple file in a web server, which only includes:
    USER-COUNT=10000;

    And it works.

    I guess this is related to how to parse html file.

     

     

    • Injeyan_Kostas's avatar
      Injeyan_Kostas
      Icon for Nacreous rankNacreous

      Hi pablo_juarez​ 

      I think it's because it matches also <br>MAXIMUM-LICENSED-USER-COUNT=0;

      could you try
      recv "<br>USER-COUNT=([0-9]{1,3}|[1-2][0-9]{3}|3000);"

  • You are completely right, I was so focused on the user-count line that hadn´t seen it was matching with previous line.

     

    [root@lb-alc-caru-vpn-1:/S1-green-P::Active:Changes Pending] config # curl http://172.28.17.170/healthcheck.html | grep "USER-COUNT"
    <br>MAXIMUM-LICENSED-USER-COUNT=0;
    <br>USER-COUNT=10000;

     

    Thank you so much!!

    • Injeyan_Kostas's avatar
      Injeyan_Kostas
      Icon for Nacreous rankNacreous

      You are welcome

      But now the million-dollar question:
      You’ve got F5s, so why are you still playing around with Ivanti? Lost a bet?