CyberAlphaWolf

Server : Apache
System : Linux 182.49.167.72.host.secureserver.net 4.18.0-553.92.1.el8_10.x86_64 #1 SMP Wed Jan 14 06:31:58 EST 2026 x86_64
User : kikai ( 1014)
PHP Version : 8.3.30
Disable Function : NONE
Directory :  /lib/fm-agent/dependencies/phacter/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/fm-agent/dependencies/phacter/utils/linux.py
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import subprocess
def getDealerAddress():
        matches = []
        cmd = [ '/usr/bin/avahi-browse', '--all', '--terminate', '--resolve' ]
        cmdp = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE)
        data = cmdp.communicate()[0]
        lines = data.split('\n')
        match_mode = False
        for line in lines:
            if line.startswith("="):
                if line.find("dealer") != -1 and line.find('IPv4') != -1:
                    match_mode = True
                else:
                    match_mode = False
            if match_mode and line.find("address") != -1 and line.find("[") != -1:
                (afirst, alast) = line.split("[",1)
                (addr, junk) = alast.split("]",1)
                if addr.find(":") == -1:
                    matches.append(addr.strip())
            if match_mode and line.find("port") != -1 and line.find("[") != -1:
                (lfirst,llast) = line.split("[",1)
                (port,ljunk) = llast.split(']',1)
                matches.append(port.strip())

        #return matches
        return ('127.0.0.1','80')

XYZEAZ - Cyber Alpha Wolf © All Rights Reserved