Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: Tweekified on November 09, 2007, 06:57:11 PM
-
I am unable to get a static IP from my ISP. I like the email server and the web server features. I just need a way to have this server notify me of ip change so i can update my domain register info to point to new ip. I would be best by email, but if could be by like icq or something like that too.
-
Look for ddclient addon. It supports many dynamic dns services and sends the e-mail with status to admin.
-
The way I do this is to run a wget command as a cron job every hour. It can then be possible to see the ip in the log of the web server. (wget http://.........). A slightly different variant is if this wget target also have a dns server that hets uptated via this link/cronjob. (That's the way I do it just now.)
-
I just need a way to have this server notify me of ip change so i can update my domain register info to point to new ip.
You want to update your domain register? How often is the IP changed. You might be doing this several times an hour. What about using DynDNS.org to register your domain dynamically for you? Or am I not understanding your post properly?
In any event, there is a fairly straightforward way using cron to see the IP on a scheduled basis. This is similar but different from what Arne is suggesting. I ran into the same problem a few years ago. We got sophisticated and wrote a script to check to see if the old external IP had changed and if so mail the new IP to us, but it got too fancy and I can't find it at the moment. A basic way to do this is in concept is:
1. Write a script that sends the ifconfig info to a temporary file eg /sbin/ifconfig > /tmp/temporaryfile
2. In that script, mail the info from the file to yourself. eg mail admin@yourdomain.com </tmp/temporaryfile
3. set this script up as a cron job using standard SME custom templates (or the crontab manager contrib). You decide how often you want the cron job invoked.
So you get regular, every second if you like, emails on what the IP is, determined by your crontab settings.
See the manual on custom templates and crontab for more information
-
put the email script (action) in one of these (events)
/etc/e-smith/events/ip-*
-
Here you go: http://bugs.contribs.org/show_bug.cgi?id=3542#c2
'IPNotify' will send an email notice to any local account or pseudonym whenever the 'ip-change' event is triggered.
Supported configuration settings:
- config set IPNotify service
- default: non-existent
- required for operation
- config setprop IPNotify status enabled
- default: disabled
- must be 'enabled' for operation
- config setprop IPNotify Notify "emailname"
- default: admin
- must be a local user or pseudonym
- must not include '@...' ('@$DomainName' will be appended automatically)
- config setprop IPNotify Subject "IP Change at my sme server"
- default: $SystemName.$DomainName IP Address Change
- config setprop IPNotify MailFrom "alerts\@mmsionline.us"
- default: admin
- will have '@DomainName' appended automatically)
- config setprop Message "Whatever Message You Want"
- default: New IP Address: $ipaddress
- I don't know how to enter something in the database that will include the latest IP address
-
I currently own a domain name via godaddy. I currently have it pointed to my current Outside IP address. But my Ip from my ISP is not static. So if they change my ip, now my webpage goes down and i am unable to remote admin if i dont know the new ip address. So if it could just email to an outside email address on change or a daily update, i could then remotely update my domain to point to new ip address.
Thanks for all the posts so far.
-
Tweekified
mmcarn provided you with a nice script to do what you want.
To send to an external email address, simply create a new user account on your sme server and then setup that user to forward to an external email address.
Configure the Notify emailname using (enter the newly created user account):
config setprop IPNotify Notify "emailname"
* default: admin
* must be a local user or pseudonym