00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <net-snmp/net-snmp-config.h>
00039 #include <net-snmp/net-snmp-includes.h>
00040 #include <net-snmp/agent/net-snmp-agent-includes.h>
00041
00042 #include "openserMIBNotifications.h"
00043 #include "../../dprint.h"
00044 #include "../../config.h"
00045
00046 static oid snmptrap_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 int send_openserMsgQueueDepthMinorEvent_trap(int msgQueueDepth,
00057 int minorThreshold)
00058 {
00059 netsnmp_variable_list *var_list = NULL;
00060
00061 oid openserMsgQueueDepthMinorEvent_oid[] = {
00062 OPENSER_OID,3,1,3,2,0,1 };
00063
00064 oid openserMsgQueueDepth_oid[] = {
00065 OPENSER_OID,3,1,3,1,2,3,1,0 };
00066
00067 oid openserMsgQueueMinorThreshold_oid[] = {
00068 OPENSER_OID,3,1,3,1,2,3,2,0 };
00069
00070 snmp_varlist_add_variable(&var_list,
00071 snmptrap_oid,
00072 OID_LENGTH(snmptrap_oid),
00073 ASN_OBJECT_ID,
00074 (u_char *)openserMsgQueueDepthMinorEvent_oid,
00075 (int)sizeof(openserMsgQueueDepthMinorEvent_oid));
00076
00077 snmp_varlist_add_variable(&var_list,
00078 openserMsgQueueDepth_oid,
00079 OID_LENGTH(openserMsgQueueDepth_oid),
00080 ASN_GAUGE,
00081 (u_char *)&msgQueueDepth,
00082 sizeof(msgQueueDepth));
00083
00084 snmp_varlist_add_variable(&var_list,
00085 openserMsgQueueMinorThreshold_oid,
00086 OID_LENGTH(openserMsgQueueMinorThreshold_oid),
00087 ASN_INTEGER,
00088 (u_char *)&minorThreshold,
00089 sizeof(minorThreshold));
00090
00091 send_v2trap( var_list );
00092 snmp_free_varbind( var_list );
00093
00094 return SNMP_ERR_NOERROR;
00095 }
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 int send_openserMsgQueueDepthMajorEvent_trap(int msgQueueDepth,
00106 int majorThreshold)
00107 {
00108 netsnmp_variable_list *var_list = NULL;
00109
00110 oid openserMsgQueueDepthMajorEvent_oid[] = {
00111 OPENSER_OID,3,1,3,2,0,2 };
00112
00113 oid openserMsgQueueDepth_oid[] = {
00114 OPENSER_OID,3,1,3,1,2,3,1,0 };
00115
00116 oid openserMsgQueueMajorThreshold_oid[] = {
00117 OPENSER_OID,3,1,3,1,2,3,3,0 };
00118
00119 snmp_varlist_add_variable(&var_list,
00120 snmptrap_oid,
00121 OID_LENGTH(snmptrap_oid),
00122 ASN_OBJECT_ID,
00123 (u_char *)openserMsgQueueDepthMajorEvent_oid,
00124 (int)sizeof(openserMsgQueueDepthMajorEvent_oid));
00125
00126 snmp_varlist_add_variable(&var_list,
00127 openserMsgQueueDepth_oid,
00128 OID_LENGTH(openserMsgQueueDepth_oid),
00129 ASN_GAUGE,
00130 (u_char *)&msgQueueDepth,
00131 sizeof(msgQueueDepth));
00132
00133 snmp_varlist_add_variable(&var_list,
00134 openserMsgQueueMajorThreshold_oid,
00135 OID_LENGTH(openserMsgQueueMajorThreshold_oid),
00136 ASN_INTEGER,
00137 (u_char *)&majorThreshold,
00138 sizeof(majorThreshold));
00139
00140 send_v2trap( var_list );
00141 snmp_free_varbind( var_list );
00142
00143 return SNMP_ERR_NOERROR;
00144 }
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 int send_openserDialogLimitMinorEvent_trap(int numDialogs, int threshold)
00156 {
00157 netsnmp_variable_list *var_list = NULL;
00158
00159 oid openserDialogLimitMinorEvent_oid[] = {
00160 OPENSER_OID,3,1,3,2,0,3 };
00161
00162 oid openserCurNumDialogs_oid[] = {
00163 OPENSER_OID,3,1,3,1,3,2,1, 0 };
00164
00165 oid openserDialogLimitMinorThreshold_oid[] = {
00166 OPENSER_OID,3,1,3,1,3,2,5, 0 };
00167
00168 snmp_varlist_add_variable(&var_list,
00169 snmptrap_oid,
00170 OID_LENGTH(snmptrap_oid),
00171 ASN_OBJECT_ID,
00172 (u_char *)openserDialogLimitMinorEvent_oid,
00173 (int)sizeof(openserDialogLimitMinorEvent_oid));
00174
00175 snmp_varlist_add_variable(&var_list,
00176 openserCurNumDialogs_oid,
00177 OID_LENGTH(openserCurNumDialogs_oid),
00178 ASN_GAUGE,
00179 (u_char *)&numDialogs,
00180 sizeof(numDialogs));
00181
00182 snmp_varlist_add_variable(&var_list,
00183 openserDialogLimitMinorThreshold_oid,
00184 OID_LENGTH(openserDialogLimitMinorThreshold_oid),
00185 ASN_INTEGER,
00186 (u_char *)&threshold,
00187 sizeof(threshold));
00188
00189 send_v2trap( var_list );
00190 snmp_free_varbind( var_list );
00191
00192 return SNMP_ERR_NOERROR;
00193 }
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204 int send_openserDialogLimitMajorEvent_trap(int numDialogs, int threshold)
00205 {
00206 netsnmp_variable_list *var_list = NULL;
00207
00208 oid openserDialogLimitMajorEvent_oid[] = {
00209 OPENSER_OID,3,1,3,2,0,4 };
00210
00211 oid openserCurNumDialogs_oid[] = {
00212 OPENSER_OID,3,1,3,1,3,2,1, 0 };
00213
00214 oid openserDialogLimitMajorThreshold_oid[] = {
00215 OPENSER_OID,3,1,3,1,3,2,6, 0 };
00216
00217 snmp_varlist_add_variable(&var_list,
00218 snmptrap_oid,
00219 OID_LENGTH(snmptrap_oid),
00220 ASN_OBJECT_ID,
00221 (u_char *)openserDialogLimitMajorEvent_oid,
00222 (int)sizeof(openserDialogLimitMajorEvent_oid));
00223
00224 snmp_varlist_add_variable(&var_list,
00225 openserCurNumDialogs_oid,
00226 OID_LENGTH(openserCurNumDialogs_oid),
00227 ASN_GAUGE,
00228 (u_char *)&numDialogs,
00229 sizeof(numDialogs));
00230
00231 snmp_varlist_add_variable(&var_list,
00232 openserDialogLimitMajorThreshold_oid,
00233 OID_LENGTH(openserDialogLimitMajorThreshold_oid),
00234 ASN_INTEGER,
00235 (u_char *)&threshold,
00236 sizeof(threshold));
00237
00238 send_v2trap( var_list );
00239 snmp_free_varbind( var_list );
00240
00241 return SNMP_ERR_NOERROR;
00242 }