Easily obtain list of sessions from Juniper Netscreen

junipernetscreenscreenosssg5tftp

I've got a Juniper Netscreen SSG-5 that occasionally gets a high session count. I've got 4096 licensed sessions, and there are times I see 3000+ for a small office (a dozen or so people). This is higher than I would like, and it makes me a bit more than curious about the sessions that are open.

Ideally, I'd throw the output of the "get session" command into a text file, but that's not something that ScreenOS has support for. At least, that I know of. Please let me know if that's the case.

Barring the ability to save the output to a file, if I could somehow obtain the session list via SNMP, I'd be content to wr/m-angle it that way, but all I've managed to find is the number of active sessions (enterprises.3224.16.3.2.0).

I could write a script using 'nc' to connect to the netscreen and hit enter repeatedly to page through the several thousand lines, but that seems less fun than doing it the "right way", if such a way exists.

Best Answer

I got it!

Unbeknownst to me, ScreenOS has the ability to pipe the output from any command to a tftp server!

The usage is:

 <command> > tftp <tftp ip address> <filename>

Now that it's a text file, I can grep, sed, and awk my weaselly little guts out.

Related Topic