Operating System - HP-UX
1819800 Members
3020 Online
109607 Solutions
New Discussion юеВ

Listen to all traps on port 162 and log it

 
SOLVED
Go to solution
Mr Zer0
Trusted Contributor

Listen to all traps on port 162 and log it

Hi all,

I want to log all the events coming on HPUX server on port 162 in a log file or atleast i should be able to view it. Is it possible?

8 REPLIES 8
Torsten.
Acclaimed Contributor

Re: Listen to all traps on port 162 and log it

This is exactly what a snmp daemon should do - do you run such a specific application?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Mr Zer0
Trusted Contributor

Re: Listen to all traps on port 162 and log it

No i think, just the HPUX OS is installed, nothing else, do we have to install something like wireshark for that?

And what would happen if one of my application is already using 162, can the new application still listen to the traps on that port?
Torsten.
Acclaimed Contributor

Re: Listen to all traps on port 162 and log it

You need a special (SNMP) application for receiving, decoding (keyword MIB) and managing traps.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Mr Zer0
Trusted Contributor

Re: Listen to all traps on port 162 and log it

I do not want to know the meaning of the trap(MIB), i just want to know from what IP's traps are coming. Can i do that directly in HPUX or i should install an application for that.
Torsten.
Acclaimed Contributor

Re: Listen to all traps on port 162 and log it

OID and IP are included in a trap header, so your application need to decode this.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Viktor Balogh
Honored Contributor
Solution

Re: Listen to all traps on port 162 and log it

"I do not want to know the meaning of the trap(MIB), i just want to know from what IP's traps are coming."

then what about tcpdump? e.g.:

# tcpdump -w tcpdump.out -C 100 -q -n -i lan5 'port 162'

****
Unix operates with beer.
Mr Zer0
Trusted Contributor

Re: Listen to all traps on port 162 and log it

Thank you,

i used tcpdump
Mr Zer0
Trusted Contributor

Re: Listen to all traps on port 162 and log it

`