Search the Community
Showing results for tags 'webpage'.
Found 1 result
This is just another Google results scrape like my exchange rate tracker (https://communities.logicmonitor.com/topic/1624-ridiculously-simple-currency-exchange-rate-monitor/), so it's more a couple of examples of how that can be done, than a particularly useful set of metrics for enterprises with fixed IPs. I only built these because my home very-nearly-static IP changed the other day after my ISP did some work locally, so my carefully-selected whitelisting to access another cloud service from home failed. Boo hiss. Note that these LogicModules will always be run by the collector, so the result will be whatever Google determine's your collector's public IP to be, regardless of which device you associate the LogicModules with. For this reason they both have AppliesTo of hasCategory("collector") which I recommend you don't change. Anyway... there's a straight and simple Webpage collection DataSource: v1.0.0: KTFNWP This calls "https://www.google.com/search?q=what+is+my+ip" and has four datapoints, each of which pulls one octet via a regex of the resultant page body, using e.g.: (\d+)\.\d+\.\d+\.\d+.*Your public IP address This is possible because Google will do the lookup for you and present the data in a consistent format; a brief check of the page source code and a visit to regex101.com is all that's then needed to determine suitable regexes: IP address is not model's own. This gives you one metric and one graph line per octet and you can set delta alerting thresholds if you wish. ConfigSource: Additionally, if you have LM Config, there's a ConfigSource that does much the same but (obviously) writes the result to a config, with the single line output "Google says my public IP address is 126.96.36.199", the IP again be regexed out of the Google response. This will alert on any change. ConfigSource v1.0.0: 3G9C63