External monitor script

arnobrebrarnobrebr Member
Hi,

I would like to create a external monitor health check that use TCP 11277 and send the command:
- "GET / ctrl_vip_acct_trrloader"

The answer expect is:
"VALUE ctrl_vip_acct_trrloader 0 27"

How can I do this in TCL script?

Tks

Best regards,
Alessandro
Tagged:

Comments

  • edited February 2014
    hello below is an external health monitor script that has been tested


    #!/usr/bin/python
    import os, sys, socket, re

    host = os.environ['HM_SRV_IPADDR']
    port = int(os.environ['HM_SRV_PORT'])
    send_string = sys.argv[1]
    send_string += "\r\n"
    receive_string = sys.argv[2]

    try:
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host, port))
    s.send(send_string)
    response = s.recv(8192)
    except:
    sys.exit(-1)
    if(None != re.search(r"%s" % receive_string, response)):
    sys.exit(0)
    else:
    sys.exit(-1)

    They applied the External HM as recommended by Mischa, considering:

    health monitor TCP-11277
    method external program "TCP Health Check" arguments "\"get / ctrl_vip_acct_trrloade\" \"VALUE ctrl_vip_acct_trrloader 0 27\""
    !
  • arnobrebrarnobrebr Member
    edited February 2014
    That´s it ssacchi, now I have the script working fine.

    Thank for help

    Regards
    Alessandro
Sign In or Register to comment.