Interview Questions

Snmp

SNMP Interview Questions & Answers

The Simple Network Management Protocol is used communicate Management Information between the Network Management System and the Network Elements.

Using SNMP, the Network operators can be able to manage their network elements, identify the fault and can configure the remote system.

The below are the list of Questions and Answers for Web Services.

SNMP Agent Using JDMK Api

In this article let’s discuss about creating a SNMP Agent using JDMK api.

Consider a scenario where you want to monitor your java application. You can do so by creating a SNMP agent and MIB. Now using the MIB you can query the SNMP agent to retrieve the status of your application. We can create the SNMP agent using JDMK (Java Dynamic Management Kit) api. We can also send SNMP traps using the same.
First let’s create a MIB and a sample SNMP agent using JDMK. Consider the following MIB.

Test-MIB.mib

Test-MIB DEFINITIONS ::= BEGIN
IMPORTS

A beginner’s guide to SNMP - Simple Network Management Protocol

What is SNMP?

The Simple Network Management Protocol is used communicate Management Information between the Network Management System and the Network Elements.

Using SNMP, the Network operators can be able to manage their network elements, identify the fault and can configure the remote system.

Let us take a simple example to understand SNMP.

Consider a Network with 1000 Network elements like routers, switches, gateways and other network devices.

Log4j - Snmp Trap Appender

In this article lets discuss about sending SNMP Traps using log4j.

SNMP Traps are messages which are sent to a server or SNMP Trap receiver listening on a particular port.

In any java application, we use logging framework such as log4j to log errors, information etc,. for debugging. Consider a scenario where it is required to send SNMP Traps when the db is down or any server down or any unusual events in the application. Whenever such an event is logged , the same can be sent as a SNMP Trap using log4j. To make this work we need to use SNMP Trap appender.

SNMP4J Trap Sender

package in.techdive.snmp4j.ex;

/**
 * Copyright 2010 TechDive.in
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <a href="http://www.apache.org/licenses/LICENSE-2.0" title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Snmp4j - Trap Receiver

/**
 * Copyright 2010 TechDive.in
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <a href="http://www.apache.org/licenses/LICENSE-2.0" title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Snmp4j - Snmp Get Next Example

SnmpGetNextExample Class

/**
 * Copyright 2010 TechDive.in
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <a href="http://www.apache.org/licenses/LICENSE-2.0" title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Snmp4j - Snmp Set Example

SnmpSetExample

/**
 * Copyright 2010 TechDive.in
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <a href="http://www.apache.org/licenses/LICENSE-2.0" title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Snmp4j - Snmp Get Example

SnmpGetExample

/**
 * Copyright 2010 TechDive.in
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <a href="http://www.apache.org/licenses/LICENSE-2.0" title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.