Ad Widget

Collapse

How to monitor internet connection based on IP address

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hrobocop
    Junior Member
    • Oct 2012
    • 22

    #1

    How to monitor internet connection based on IP address

    Hi,

    I'm looking for a sollution for this scenario:

    In our office, we have two internet connections: main line via cable and backup line via VDSL (better ADSL). Both connections have fixed IP address. We have Mikrotik Router which automatically switch from main to backup connection when mail line doesnt work (it looks like that all the networking guys are based in Riga .

    On external server (outside office) I have simple PHP script which returns plain text IP address withou any HTML formatig. Its sigle line of code in PHP:
    <?=$REMOTE_ADDR?>

    On zabbix, I created on "Zabbix server" host application with name "INternet connection" and there is one item - "Internet connection IP" - I store IP address in plaintext, so type of item is "text" and I get value by "Zabbix agent" type, Key is "web.page.get[yourserver.com,plain-ip.php,80]"

    Now there can be basically three values in this key: our primary IP address (we're connected via main line), our backup IP address (we are connected via backup line) or no value or some error - we are not connected at all.

    I would like to setup triggers, but it seems that triggers cannot operate with text fields.

    Should I use regexp fox this? Or any other sollution which leads to same results?

    Thank you for any help!
  • Hrobocop
    Junior Member
    • Oct 2012
    • 22

    #2
    One more trouble: web.page.get stores result with headers, any way how to store just the result WITHOUT headers?

    Comment

    • Hrobocop
      Junior Member
      • Oct 2012
      • 22

      #3
      Finally, solved by using external sh script with curl / grep

      Comment

      Working...