Bash script to monitor internal IP for changes
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
I would like to know if a script can the the information from an ifconfig...
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000
And then dump the information to something like:
eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.
I want to us 'ifconfig' and not 'ip' command.
bash monitor ip
add a comment |Â
up vote
0
down vote
favorite
I would like to know if a script can the the information from an ifconfig...
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000
And then dump the information to something like:
eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.
I want to us 'ifconfig' and not 'ip' command.
bash monitor ip
3
What kind of progress have you made so far? Also, why notip
?
â dsstorefile1
Apr 19 at 21:36
No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
â user2616163
Sep 6 at 20:36
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would like to know if a script can the the information from an ifconfig...
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000
And then dump the information to something like:
eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.
I want to us 'ifconfig' and not 'ip' command.
bash monitor ip
I would like to know if a script can the the information from an ifconfig...
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 111.222.111.222 netmask 255.255.255.0 broadcast 111.222.111.255
inet6 fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
ether f0:de:f1:f1:65:70 txqueuelen 1000 (Ethernet)
RX packets 3623628 bytes 428280329 (408.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1895180 bytes 1618756896 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf3900000-f3920000
And then dump the information to something like:
eth0
ipv4: 111.222.111.222 netmask: 255.255.255.0 broadcast 111.222.111.255
ipv6: fe80::f2de:f1ff:fef1:6570 prefixlen 64 scopeid 0x20<link>
I would like the script to include all enabled non-loopback interfaces. I would like to then set up cron to check for any changes, and then if there is a change, to email me all the information to my gmail. Any changes should either be bold or displayed in such a way it can be easily identified. Even if it is a different section.
I want to us 'ifconfig' and not 'ip' command.
bash monitor ip
edited Sep 6 at 20:33
asked Apr 19 at 20:20
user2616163
283
283
3
What kind of progress have you made so far? Also, why notip
?
â dsstorefile1
Apr 19 at 21:36
No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
â user2616163
Sep 6 at 20:36
add a comment |Â
3
What kind of progress have you made so far? Also, why notip
?
â dsstorefile1
Apr 19 at 21:36
No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
â user2616163
Sep 6 at 20:36
3
3
What kind of progress have you made so far? Also, why not
ip
?â dsstorefile1
Apr 19 at 21:36
What kind of progress have you made so far? Also, why not
ip
?â dsstorefile1
Apr 19 at 21:36
No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
â user2616163
Sep 6 at 20:36
No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
â user2616163
Sep 6 at 20:36
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026515%2fbash-script-to-monitor-internal-ip-for-changes%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
What kind of progress have you made so far? Also, why not
ip
?â dsstorefile1
Apr 19 at 21:36
No progress. I had a reason why ifconfig and not IP when I posted this, but don't remember now. Guess either would work fine.
â user2616163
Sep 6 at 20:36