Search drive for files containing an IP address

Discussion in 'HOWTO-Related Questions' started by tfunky, Mar 19, 2008.

  1. tfunky

    tfunky New Member

    Hi All,

    This should be really easy, but I can't figure it out...

    I made a copy of the HAProxy load balancers from the howto and modified them to use new IPs for a new site.

    Somewhere along the line I missed an IP and it still shows on the

    ip addr sh eth0


    I've checked the files where I know IP info is located and I'm not seeing it.

    my thought is that I should be able to use grep to search the drive for the old IP address and find the culprit.


    Can someone please help me with the correct syntax to find this?

    I've googled and the best I can find is (from /):

    grep -r --with-filename --line-number `192\.168\.1\.101`

    but that doesn't get it and I'm not sure why not.

    Can someone help me understand what I'm doing wrong?

    THanks!

    Tfunk
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What exactly is the problem?

    Did you use the tutorial about HAProxy + heartbeat, or the HAProxy + keepalived one?
     
  3. tfunky

    tfunky New Member

    I used the haproxy/heartbeat howto...

    The problem is that I originally used a HAproxy/heartbeat load balancer pair from my webservers (setup for http) and copied them, changed the IP, hostnames, etc etc to use them as the MySQL load balencers.

    The problem is that somewhere I missed an old IP address.

    If I do ip addr sh eth0
    I see the following:

    Code:
    db-hap1:~# ip addr sh eth0
    2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:0c:29:9d:38:a1 brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.18/24 brd 192.168.1.255 scope global eth0
        inet 192.168.168.10/32 scope global eth0
        inet 192.168.1.10/24 brd 192.168.1.255 scope global secondary eth0:0
        inet6 fe80::20c:29ff:fe9d:38a1/64 scope link tentative
           valid_lft forever preferred_lft forever
    db-hap1:~#
    
    See the 192.168.168.10? That's an artifact from where they were originally installed. Somewhere I've missed changing it.

    I've checked :

    /etc/haproxy.cfg
    /etc/ha.d/ha.cf
    /etc/ha.d/haresources
    and, of course, /etc/network/interfaces

    the 192.168.168. address isn't in any of those files.

    I know it possible to use grep to search the files on your hard drive for a specific string, but I can't figure out the proper syntax.

    My thought is that address has to be in a text files somewhere...I just need to find it to remove it.

    If I can use grep to scan all files on the drive, and report any time it find 192.168.168.10 then that will allow me to fix it.

    Is that more clear on what I've messed up and how I'm trying to fix it?

    Thanks!
     
  4. tfunky

    tfunky New Member

    I just noticed that this is WAY in the wrong section of the forum...Sorry...I thought I had put it into the howto section :(

    Sorry to clutter the ISPConfig section up :(
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Try
    Code:
    grep -r "192.168.168.10" /
     

Share This Page