Putty Logfiles with timestamp

I am just trying to automate my Cisco telnet and SSH connection to get nice information that is not provided by the Cisco SNMP Mib jet.

I am talking about the “show crypto session” command. The output looks a little like this:

WanRouter#sh crypto session isakmp group remoteaccess
Crypto session current status

Interface: FastEthernet0/0
Username: admin
Profile: VPNClient
Group: remoteaccess
Assigned address:
Session status: UP-ACTIVE     
Peer: port 1483 
  IKE SA: local remote Active 
  IPSEC FLOW: permit ip host 
        Active SAs: 2, origin: dynamic crypto map

To get hold of the user that are connected I need to get this information. Some bash magic helps later on to get it in e.g Nagios or other NMS systems.

To obtain this information you can either use your usual linux machine with the usage of expect. Or you use your windows machine with Putty.

Enable the “printable output” in the “Session logging” option.

If you use putty it is easy to enable the logging mechanisms. But the trick is to use predefined macros to for the
‘Log file name’.

Just add to the log file name line:


Putty logging configuration

The output in my log folder looks like:

log folder

All logfiles contain the printable output of this session, each file with an unique name due to the timestamp.

1 comment for “Putty Logfiles with timestamp

Leave a Reply

Your email address will not be published. Required fields are marked *