Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
TrapViewerApplication.java
Package: AdventNetSNMPAPI_4.zip [view]
Upload User: aonuowh
Upload Date: 2021-05-23
Package Size: 35390k
Code Size: 2k
Category:
SNMP
Development Platform:
C/C++
- /* $Id: TrapViewerApplication.java,v 1.3.2.3 2009/01/28 12:51:12 prathika Exp $ */
- /*
- * @(#)TrapViewerApplication.java
- * Copyright (c) 1996-2009 AdventNet, Inc. All Rights Reserved.
- * Please read the associated COPYRIGHTS file for more details.
- */
- /**
- * This is a example program for TrapViewer bean .
- * The TrapViewer is used to receive traps on a specified port, parsing received
- * traps based on a parser file and display the parsed traps. Traps are shown based
- * on match criteria. Trap parser file should have set of match criteria. The
- * match criteria is called TrapParser. We can specify any number of TrapParsers
- * in a TrapParser file.
- */
- import javax.swing.*;
- import java.awt.event.*;
- import com.adventnet.snmp.ui.*;
- //import ParseOptions;
- public class TrapViewerApplication extends JFrame {
- // the main method for this application
- public static void main(String [] args) {
- String usage = "java TrapViewerApplication [-p port] [-c community] [-m MIB_files] [-f parser_file]";
- String options[] = { "-p", "-c", "-m", "-f"};
- String values[] = { null, null, null, null};
- ParseOptions opt = new ParseOptions(args,options,values, usage);
- //Instantiate TrapViewer
- TrapViewer trapviewer = new TrapViewer();
- if (values[0] != null) {
- try {
- // set the port for receiving traps
- trapviewer.setPort(Integer.parseInt(values[0]));
- } catch (Exception ex) {
- System.err.println("Error setting port : " + ex.getMessage());
- }
- }
- if (values[1] != null) {
- trapviewer.setCommunity(values[1]);
- }
- if(values[2] != null) {
- try {
- trapviewer.setMibModules(values[2]);
- }
- catch(Exception e) {
- System.out.println("Mib Loading Failed: " + e.getMessage());
- }
- }
- if (values[3] != null) {
- // set the parser file for parsing traps
- trapviewer.setFileName(values[3]);
- }
- TrapViewerApplication frame = new TrapViewerApplication();
- frame.setTitle("TrapViewerApplication");
- frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent evt) {
- System.exit(0);
- }
- });
- frame.getContentPane().add(trapviewer);
- frame.setSize(600,350);
- frame.setVisible(true);
- }
- }