Geting logs from multiple nodes
Hi.
Scripting is not my field so I'm having issues with making a script. This is the situation: I'm connected to the system and authorized. I want to connect to several RBSs and get alarms from them. Basically I need to do this on for each node: Code:
crt.Screen.Send "amos nodeID" & chr(13) Some help would be appreciated. |
Hi aqelmo,
Version of SecureCRT? Quote:
Please list the *explicit* steps as to how you would accomplish the task manually. |
Hi,
Unfortunately, I'm using a really old version, 6.1.4. Apparently "it's working and you don't need a new one". It's Ericsson system for managing radio base stations. Literally what I need to do is: amos node1 (connect to node node1) al (list alarms) q (disconnect) amos node2 al q amos node3 al q . . . I would also append to separate log files for each node, that I know how to do. |
Hi aqelmo,
It is still not clear to me if you are connected to the nodes or need to connect in the script. If already connected, it is fairly easy to iterate over the connected tabs with a For/Next loop: Code:
Sub Main() |
Hi.
I'm initially connected to the management system (jump host?) and then within the same session connect, issue commands and disconnect from managed nodes. If I record the session as a script it looks like this: Code:
Sub Main Code:
Sub Main |
Hi aqelmo,
How do you know what that first send is going to be? Is it always amos 0001, amos 0002, amos 0003? If not, where do you get the data from? How do you know what node(s) you will connect to? Because even in a script, you have to know how to determine what to send, if that makes sense. :) If just the three … Code:
For i = 1 to 3 |
Hi.
There are a few hundred nodes. I can export the list of nodes and get a file with single node ID per line. That should be an OK format for import? Since the list of nodes changes over time, it would be best to have it separately and not hardcoded into the script. |
Hi aquelmo,
So are all worked on at the same time? Or could it be amos 0015 to amos 0102, for example, at any given time? If so, you can prompt the user for which nodes they will be working on (assuming they all have the amos prefix). Or you could pass those as arguments to the script. |
After a lot of try and error, I managed to hack something that does what I want to do.
stop logging my session loop connect to node get alarms append to log file for that node quit stop logging end loop start logging my normal session Now I need to get it to populate hosts aray from a file, instead of hardcoding it. But coffee 1st. Code:
# $language = "VBScript" |
Hi aqelmo,
Congrats on your progress! The previously referenced script (RunCommandsOnMultipleHostsAndLogResults) illustrates reading from a file. I understand when users feel a script has "more than they need" but it can still be used to borrow the relevant pieces of code. :) |
I'm looking at it atm.
That and scripting essentials pdf. |
All times are GMT -6. The time now is 06:33 AM. |