Angelo Sciancalepore
Angelo Sciancalepore

Reputation: 19

Zabbix 5.4.3 - How to monitor a string in a webpage and define a trigger when it changes

I am using Zabbix 5.4.3 to monitor all of my company hosts.

I want to monitor a local website address (eg. https://172.30.200.1:44443/login) which is our firewall webpage.

It has got two linked WANs, one with our primary public IP and another which is a 4G backup connection without public IP (random access IP).

When the connection of the primary one goes down, the firewall automatically switches from one WAN to the another and the IP changes.

On the firewall webpage, the current used IP is always showed and updated. (see image for reference)

Firewall administration page which shows the public IP

Is there a way to set a trigger which shows that the IP has changed from our primary to the secondary random one based on the checks on this string? I need simply a trigger which shows "IP CHANGED FROM THE PRIMARY TO THE OTHER" and nothing more.

I am able to perform a webscenario configuration inside the firewall host setup in Zabbix (with also a login), but I can't understand how to setup a trigger of this kind.

Let me know guys.

Upvotes: -1

Views: 1664

Answers (2)

depak
depak

Reputation: 206

You can create a data element of the "HTTP agent" type and use a regular expression to take the IP address from the page source code, then configure the trigger:

 last(http_agent_item) <> last(http_agent_item,#2:now-(your interval))

Upvotes: 0

MisterX
MisterX

Reputation: 11

Hi you can active "required string" functionality of web monitoring. It use regular expression pattern. Ciao!

Required string: Required regular expression pattern. Unless retrieved content (HTML) matches the required pattern the step will fail. If empty, no check on required string is performed. For example: Homepage of Zabbix Welcome.admin Note: Referencing regular expressions created in the Zabbix frontend is not supported in this field. User macros and {HOST.} macros are supported. https://www.zabbix.com/documentation/5.4/en/manual/web_monitoring

Upvotes: 1

Related Questions