Config t prompt, change command
Hey guys. I was looking for some advice/assistance. I've never worked with these tools before, so know little about what i'm about to ask.
I was looking for a tool that when i enter config t mode on a cisco box, it prompts a box for a ticket number. If the box is closed, it exits config mode. If a ticket is entered, it changes the snmp contact string to show the ticket number. this way we have an additional layer to track changes made by people. I've mixed and matched other code i've seen posted around the internet and have a bit of what i think i will need, but looking for improvement/guidance but mostly i want to know of the best way to get this applied to hundreds of users across the globe. I'm not sure how to do that. Not sure if i can make it a script that gets loaded when the PC boots up, or if it becomes a part of CRT, or how to enforce its use, etc. If anyone has insight into how to distribute it and ensure it actually gets used other than relying on people to execute it, i'd appreciate it (i dont trust the users to do it, so i want to make sure it's forced). Here's the base code i grabbed and hope it works... i'd love input to fix/improve it. Hell, i'd also like to know what software to use because quite frankly i have only picked and pulled. This isn't exactly my territory/comfort zone. but mainly i'm interested in figuring out a method to force the users to use it and make it a part of their system. Code:
# $language = "VBScript" again, my biggest concern is distributing this and how. what software is needed, what tools/method can i use to deploy this globally and make sure my people are using it and aren't relied upon doing it manually. |
Hi tard01,
SecureCRT does not have a way to force a user to run scripts. Further, I am not aware of a way to force a user to run a particular program. How do you envision restricting use to just running the scripts? Quote:
Are you encountering a problem running your script? |
rtb,
the computers we use are locked down so only securecrt is available for use. Putty is available, but not readily. they can not install the app, only use the web run version, so its use it sparse. As far as forcing users to do it, i know it's possible. I've seen it deployed. User made no effort and when they installed securecrt, it already had the built in script as part of the program. How they got it embedded is a mystery to me, part of what i'm trying to figure out. The script was invisible to the user, minus the pop up asking for the ticket. The code i posted is not tested. Nor does it work. It actually has a permanent loop on the prompt box. it was just pasted as an example of the goal i'm trying to use to hopefully give some clue to anyone wondering. I basically took versions from other pieces of things ive seen and meshed them together. I've gotten the script to work (minus the loop i had issues with, but will work on later - likely a syntax thing). I've seen it deployed as such that... user logged into a PC, it was pre-loaded with applications (includes securecrt). user loads securecrt upon entering config t, user is prompted by a window asking for ticket if no ticket, the program ends config mode if ticket, the script records all output until config mode ends. When config mode ends, the "snmp contact" string is changed/updated to reflect the ticket number .... following that, a log file/server was updated with the changes made, and later we added an email was sent to the shift lead on duty automatically. ideally i'd like to replicate that efficiency. Just starting the ground work on determining how to go about accomplishing it using the tools/resources available to me. |
Hi tard01,
Thanks for the information. Quote:
If you just want the script to run when a connection is established, then you can enable the Logon script: option located in the Connection / Logon Actions category of the Session Options dialog. If you have the ability to access the place where you have seen your goal achieved, please get the information. I would certainly be interested in knowing what they have done. Quote:
Code:
Exit Do Quote:
|
Quote:
the reason i was posting here was in hopes of figuring out how it was 'hidden'. For instance, the users never clicked the scripts tab to turn it off/on. If they opened securecrt, it was automatically ready to go. How they accomplished that is a complete mystery to me. The only way i knew to bypass it was to use a different tool, which was a big no-no there. Unfortunately i do not recall if there was anything even visible in the scripts tab. I never checked. As far as removing functionality, i never noticed any hindrances (at least for the purposes we use securecrt for). We could still use tabs, change settings, add login scripts, add hotkeys, etc. I wish i could provide more info regarding what was used before, that would be helpful to me as well, hah. The burden is knowing it's possible, but not knowing the bridge to get there. That's what i'm aiming to figure out. |
Hi tard01,
As mentioned previously, you can automatically launch a script upon connecting by defining a Logon script for the session (or Default Session if you are using Quick Connect). This is easy to circumvent, but it is one way you can allow a user to connect and run a script without any user interaction other than connecting. Another way that is as easily circumvented is to launch the script from the command-line, but this only applies to the first tab. If the user launches another session in another tab, then they will not have the script running. Here is an example command-line that will launch a script when starting SecureCRT: Code:
C:\Program Files\VanDyke Software\SecureCRT>SecureCRT /script c:\Users\<username>\Desktop\ticket.vbs Do either of these options sound like they might work for you? |
All times are GMT -6. The time now is 09:45 PM. |