PyHeartBeat Client in PERL?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GMane Python

    #1

    PyHeartBeat Client in PERL?

    Hello Everyone.

    Whil e reading the Python Cookbook as a means of learning Python, I
    came across the script by Nicola Larosa. Not knowing anything about PERL, I
    was wondering if there were a translation in PERL so I could have my Netware
    servers send heartbeats to the heartbeat server? Thanks!

    Dave



    Title: PyHeartbeat - detecting inactive computers
    Submitter: Nicola Larosa





    # Filename: HeartbeatClient .py

    """Heartbea t client, sends out an UDP packet periodically"""

    import socket, time

    SERVER_IP = '127.0.0.1'; SERVER_PORT = 43278; BEAT_PERIOD = 5

    print ('Sending heartbeat to IP %s , port %d\n'
    'press Ctrl-C to stop\n') % (SERVER_IP, SERVER_PORT)
    while True:
    hbSocket = socket.socket(s ocket.AF_INET, socket.SOCK_DGR AM)
    hbSocket.sendto ('PyHB', (SERVER_IP, SERVER_PORT))
    if __debug__: print 'Time: %s' % time.ctime()
    time.sleep(BEAT _PERIOD)




Working...