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: 192.168.100.1
Session status: UP-ACTIVE     
Peer: 192.168.1.10 port 1483 
  IKE SA: local 10.0.0.2/500 remote 192.168.1.10/1483 Active 
  IPSEC FLOW: permit ip 0.0.0.0/0.0.0.0 host 192.168.100.1 
        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:

c:\tmp\log-&h-&T.log

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 *