SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 Re: Help & Support (Stable) » Conky Toughie! » 2009-03-05 09:16:18

I wrote a python script that does exactly what you want!

#!/usr/bin/python
# Quick and dirty script to output hosts ip via nmap by ikex <ikex@orioncode.org>

# change this to change you output! :)
nohost = "(No Hostname)"
output = "%s %s Appears to be up!" # IP, Hostname
nip= "10.1.1.0/24"

import os, socket, types
fp = os.popen("nmap -sP %s" % nip)
dat=fp.read()
dat=dat.split('\n')
for line in dat:
    try: dummy = int(line[5:6])
    except (ValueError): continue
    if line[:4] == "Host":
        ip=line.split(' ')[1]
        try:
            host="("+socket.gethostbyaddr(ip)[0]+")"
        except:
            host=nohost
        print output % (ip, host)

And outputs something like

ikex@ikebox ~
$ scanup.py
10.1.1.2 (mpeters-PC) Appears to be up!
10.1.1.3 (No Hostname) Appears to be up!
10.1.1.4 (tnew-PC) Appears to be up!
10.1.1.6 (No Hostname) Appears to be up!
10.1.1.7 (ikebox) Appears to be up!

(I only tested this on my desktop(via cygwin) but i can't see why it wouldn't work under #!)

#2 Introductions » Woo » 2009-03-05 05:04:15

ikex
Replies: 2

Hey everyone!

After trying more distro's then i can count(including a 4 day Gentoo compile) for my eee I've finally found the one.
I absolutely love #! the speed the look the everything ^-^

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo