System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to send SNMP_TRAP message manually for test

SOLVED
Go to solution
Md. Minhaz Khan
Super Advisor

How to send SNMP_TRAP message manually for test

Dear ALL,

I have configured my HP-UX system using EMS(monconfig) to send SNMP_TRAP message to a central server.In the central server we used Microsoft System Operation Manager(SCOM).

My query is how can i send SNMP_TRAP message manually from HP-UX machine to a central server(SCOM)for test purpose.

I have follow following procedure to send alerts using snmp from HP-UX machine:


Step1:

**i get the mib file to recognise snmp traps :

software.hp.com

Event Monitoring Service (EMS) Developer's Kit

https://h20392.www2.hp.com/portal/swdepot/try.do?productNumber=B7611BA

Now Login as root and copy the depot under /tmp directory
#swinstall -s /tmp/B7611BA_A.04.20.11.03_HP-UX_B.11.11_32_64.depot

Step2: add entry to the /etc/snmpd.conf

trap-dest: IP_trap_server

Step3: restart snmpd server and the snmpd-components. ( or reboot the server )

i made a simple script to make all steps 2 and 3

#=========================================

set -x
echo "trap-dest: 10.36.65.70" >>/etc/snmpd.conf
sleep 2
/sbin/init.d/SnmpMaster stop
sleep 2
/sbin/init.d/SnmpMaster start
sleep 10
/sbin/init.d/SnmpMib2 stop
sleep 2
/sbin/init.d/SnmpMib2 start
sleep 2
/sbin/init.d/SnmpHpunix stop
sleep 2
/sbin/init.d/SnmpHpunix start

#=========================================

3, run /etc/opt/resmon/lbin/monconfig

==================================================================
==========
============== Monitoring Request Manager Main Menu ==============
==================================================================
==========

Note: Monitoring requests let you specify the events for monitors
to report and the notification methods to use.

Select:
(S)how monitoring requests configured via monconfig
(C)heck detailed monitoring status
(L)ist descriptions of available monitors
(A)dd a monitoring request
(D)elete a monitoring request
(M)odify an existing monitoring request
(E)nable Monitoring
(K)ill (disable) monitoring
(H)elp
(Q)uit
Enter selection: [s] a



==================================================================
==========
===================== Add Monitoring Request =====================
==================================================================
==========

Start of edit configuration:

A monitoring request consists of:
- A list of monitors to which it applies
- A severity range (A relational expression and a severity. For example,
< "MAJOR WARNING" means events with severity "INFORMATION" and
"MINOR WARNING")
- A notification mechanism.
Please answer the following questions to specify a monitoring request.

Monitors to which this configuration can apply:
1) /StorageAreaNetwork/events/SAN_Monitor
2) /system/events/cpu/cmc
3) /system/events/cpu_hitachi/cmc
4) /system/events/cpe
5) /system/events/cpe_hitachi
6) /storage/events/disks/default
7) /storage/events/disks_asama/default
8) /storage/events/disks_hitachi/default
9) /adapters/events/TL_adapter
10) /connectivity/events/hubs/FC_hub
11) /connectivity/events/switches/FC_switch
12) /adapters/events/fclp_adapter
13) /adapters/events/iscsi_adapter
14) /system/events/dm_memory_asama
15) /system/events/memory_azusa
16) /adapters/events/ql_adapter
17) /adapters/events/raid_adapter
18) /adapters/events/sas_adapter
19) /storage/events/enclosures/ses_enclosure
20) /system/events/ups
21) /storage/events/disk_arrays/FC60
22) /system/events/ipmi_fpl
23) /storage/events/enclosures/gazemon
24) /system/events/ia64_corehw
25) /system/events/ia64_corehw_asama
26) /system/events/ipfcorehw_hitachi
27) /system/events/ipfmemory_hitachi
28) /system/events/memory_ia64
29) /storage/events/disk_arrays/MSA1000
30) /storage/events/enclosures/msamon_sas
31) /system/events/system_status
Enter monitor numbers separated by commas
{or (A)ll monitors, (Q)uit, (H)elp} [a] a------------->

Criteria Thresholds:
1) INFORMATION 2) MINOR WARNING 3) MAJOR WARNING
4) SERIOUS 5) CRITICAL
Enter selection {or (Q)uit,(H)elp} [4] 2------------->

Criteria Operator:
1) < 2) <= 3) > 4) >= 5) = 6) !=
Enter selection {or (Q)uit,(H)elp} [4]

Notification Method:
1) UDP 2) TCP 3) SNMP 4) TEXTLOG
5) SYSLOG 6) EMAIL 7) CONSOLE
Enter selection {or (Q)uit,(H)elp} [6] 3------------->

User Comment:
(C)lear (A)dd
Enter selection {or (Q)uit,(H)elp} [c] a------------->


Enter comment: []
ERROR: input required.
Please re-enter: SNMP2------------->


Client Configuration File:
(C)lear
Use Clear to use the default file.
Enter selection {or (Q)uit,(H)elp} [c]


New entry:
Send events generated by all monitors
with severity >= MINOR WARNING to SNMP
with comment:
SNMP2


Are you sure you want to keep these changes?
{(Y)es,(N)o,(H)elp} [n] y--------------------------->

Changes will take effect when the diagmond(1M) daemon discovers that
monitoring requests have been modified. Use the 'c' command to wait for
changes to take effect.



==================================================================
==========
============== Monitoring Request Manager Main Menu ==============
==================================================================
==========

Note: Monitoring requests let you specify the events for monitors
to report and the notification methods to use.

Select:
(S)how monitoring requests configured via monconfig
(C)heck detailed monitoring status
(L)ist descriptions of available monitors
(A)dd a monitoring request
(D)elete a monitoring request
(M)odify an existing monitoring request
(E)nable Monitoring
(K)ill (disable) monitoring
(H)elp
(Q)uit
Enter selection: [s]



==================================================================
==========
=================== Current Monitoring Requests ==================
==================================================================
==========

EVENT MONITORING IS CURRENTLY ENABLED.

The current monitor configuration is:
1) Send events generated by all monitors
with severity >= MAJOR WARNING to SYSLOG
2) Send events generated by all monitors
with severity >= INFORMATION to TEXTLOG /var/opt/resmon/log/event.log
3) Send events generated by all monitors
with severity >= MINOR WARNING to SNMP
4) Send events generated by all monitors
with severity >= MINOR WARNING to SNMP
with comment:
SNMP2

2 REPLIES
Dave.
Valued Contributor
Solution

Re: How to send SNMP_TRAP message manually for test

There is a command to test EMS monitoring and this should work, check out
http://docs.hp.com/en/diag/ems/ems_test.htm
for details.
Put simply
# send_test_event -va disk_em
should display, verbosely(-v) and show the resources used (-a),as I have had failures where the resources are not available and so it does not work. This will send events for your disks which should result in SNMP traps being sent.
Hope that Helps, Chrs Dave.
Regards, Dave
Md. Minhaz Khan
Super Advisor

Re: How to send SNMP_TRAP message manually for test

Thanks smith.