Simon icon Simon
Flexible server monitoring

Changing IP Address

I have access to a web server that has my IP address added to the firewall for FTP and cPanel access. Occasionally my ISP will change my IP address and I can no longer access the server. I only find out about this when I need to access the server.

Is there a test in Simon that I'm missing that will directly monitor the external IP address?

Failing that, I've tried two things:

1. Monitoring myipaddress.com for changes. Unfortunately, it's putting up a CAPTCHA even if I query it only every 12 hours. I suppose I can find another service.

2. Monitoring example.com/cpanel and generating a failure on timeout. This works, but for some reason -- now that my IP address has been whitelisted -- the test in Simon is reporting NSURLErrorDomain error -1012 instead of a timeout and still generates an error. I can load the website just fine in Safari.

Maybe I'll just post a page to one of my servers to return the IP address and test that page instead:

<?php
echo $_SERVER['REMOTE_ADDR'];
?>

David Sinclair's picture

Re: Changing IP Address

Yes, monitoring a page like that would be a good solution.

You could also monitor some other site that reports your IP, without any hoops to jump through, e.g. I like What Is My IP.

Re: Changing IP Address

I just realized that neither #1 nor #3 will work, because I'd really like to be notified of the failure, not the change. If the IP address changes I only get notified once, but I can get notified of the failure repeatedly until I fix the issue.

Is there a filter that I can apply to #1 that will accomplish that? Or do you have an idea why Simon is reporting that error -- even after relaunching it?

Re: Changing IP Address

BTW, that error code is apparently "NSURLErrorUserCancelledAuthentication"

Re: Changing IP Address

Aha! Port Available will do it. cPanel on that server (most servers) is on port 2082; all I have to do is check to see if that port is available.

David Sinclair's picture

Re: Changing IP Address

Not sure about the error, but yes, you can use an Override filter to alter a Change into a Failure. That wouldn't give the repeating effect, though, since the next check wouldn't be a change.

You could use a Find Required filter to look for your IP and give an error if not found, though you'd have to edit the test whenever it did to clear the error.

David Sinclair's picture

Re: Changing IP Address

Good thought about Port Available.

Re: Changing IP Address

Just wanted to note that this came in very handy for me yesterday. Using the Port Available test, along with an Annoying Buzzer notifier and Prowl notifier (Growl notifier modified to trigger on failure, Prowl action enabled for Simon notifications), I found out far in advance that my IP address had changed and sent off a support request to have the firewall whitelist updated before I needed it.