Commit 65081c5b authored by Praveen Kumar Shanmugam's avatar Praveen Kumar Shanmugam

broctl have hang bug so kill the instance before making the transition

parent 740485bb
......@@ -3,8 +3,6 @@ spawn sudo /usr/local/bro/bin/broctl
#expect ">" { send "help\r" }
expect ">" { send "stop\r" }
expect ">" { send "check\r" }
expect ">" { send "install\r" }
expect ">" { send "start\r" }
expect ">" { send "status\r" }
......
......@@ -21,8 +21,20 @@ def sendIDSScalingMsg(usage):
print "Stay in the same state"
else:
mode_filename = "idsmode.file";
transition_state="idstransition.file"
if os.path.exists(transition_state) is True:
print "Transition in progress don't do anythin"
return ;
else:
f = open(transition_state, 'w');
f.close();
print "Transition file created"
if os.path.exists(mode_filename) is True:
print "Already in cluster mode"
print "Clearing transition states"
os.remove(transition_state)
return ;
print "In standalone mode"
f = open(mode_filename, 'w')
......@@ -33,6 +45,9 @@ def sendIDSScalingMsg(usage):
print "Copy the node.cfg to etc and restart bro"
new_config_file='/home/ubuntu/node.cfg'
cmdlist = []
print "kill all bro manually as there is a lock bug which hangs broctl"
killbro = "sudo ps aux | grep bro | awk '{print $2}' | xargs sudo kill -9 $1"
cmdlist.append(killbro)
copycmd = "sudo cp /home/ubuntu/node.cfg /usr/local/bro/etc/node.cfg"
cmdlist.append(copycmd);
brocmd = "sudo /home/ubuntu/./restartbro.exp"
......@@ -43,6 +58,9 @@ def sendIDSScalingMsg(usage):
out, err = p.communicate()
print out, err
print "Transition Complete.. Remove state file"
os.remove(transition_state);
return 0
if __name__ == '__main__':
......
  • new snapshot created for IDS cp -v /var/lib/glance/myimages/b8b3c1cb-9b32-4b32-99b3-ffd9c73be128 /proj/TCloud/spraveen/images/brocluster.qcow2

  • Bro is configured to discard checksum in the local.bro config file This helps pick up events for ftp whitelisting

    redef ignore_checksums = T;

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment