Tuesday, October 21, 2014

Linux SNMP OID’s for CPU, Memory and Disk Statistics


Linux SNMP OID’s for CPU, Memory and Disk Statistics

Simple Network Management Protocol (SNMP) is an "Internet-standard protocol for managing devices on IP networks. It is used mostly in network management systems to monitor network-attached devices for conditions that warrant administrative attention. SNMP is a component of the Internet Protocol Suite as defined by the Internet Engineering Task Force (IETF). It consists of a set of standards for network management, including an application layer protocol, a database schema, and a set of data objects.

SNMP exposes management data in the form of variables on the managed systems, which describe the system configuration. These variables can then be queried (and sometimes set) by managing applications.

MIBs and OIDs Overview

SNMP itself does not define which information (which variables) a managed system should offer. Rather, SNMP uses an extensible design, where the available information is defined by management information bases (MIBs). MIBs describe the structure of the management data of a device subsystem; they use a hierarchical namespace containing object identifiers (OID). Each OID identifies a variable that can be read or set via SNMP. OIDs or Object Identifiers uniquely identify manged objects in a MIB hierarchy. This can be depicted as a tree, the levels of which are assigned by different organizations. Top level MIB object IDs (OIDs) belong to different standard organizations. Vendors define private branches including managed objects for their own products.

Here are some useful OID's on Linux:

Network Interface Statistics

List NIC names: .1.3.6.1.2.1.2.2.1.2
Get Bytes IN: .1.3.6.1.2.1.2.2.1.10
Get Bytes IN for NIC 4: .1.3.6.1.2.1.2.2.1.10.4
Get Bytes OUT: .1.3.6.1.2.1.2.2.1.16
Get Bytes OUT for NIC 4: .1.3.6.1.2.1.2.2.1.16.4

CPU Statistics

Load
1 minute Load: .1.3.6.1.4.1.2021.10.1.3.1
5 minute Load: .1.3.6.1.4.1.2021.10.1.3.2
15 minute Load: .1.3.6.1.4.1.2021.10.1.3.3

CPU times
percentage of user CPU time: .1.3.6.1.4.1.2021.11.9.0
raw user cpu time: .1.3.6.1.4.1.2021.11.50.0
percentages of system CPU time: .1.3.6.1.4.1.2021.11.10.0
raw system cpu time: .1.3.6.1.4.1.2021.11.52.0
percentages of idle CPU time: .1.3.6.1.4.1.2021.11.11.0
raw idle cpu time: .1.3.6.1.4.1.2021.11.53.0
raw nice cpu time: .1.3.6.1.4.1.2021.11.51.0

Memory Statistics

Total Swap Size: .1.3.6.1.4.1.2021.4.3.0
Available Swap Space: .1.3.6.1.4.1.2021.4.4.0
Total RAM in machine: .1.3.6.1.4.1.2021.4.5.0
Total RAM used: .1.3.6.1.4.1.2021.4.6.0
Total RAM Free: .1.3.6.1.4.1.2021.4.11.0
Total RAM Shared: .1.3.6.1.4.1.2021.4.13.0
Total RAM Buffered: .1.3.6.1.4.1.2021.4.14.0
Total Cached Memory: .1.3.6.1.4.1.2021.4.15.0

Disk Statistics

Add the following line to snmpd.conf and restart:

includeAllDisks 10% for all partitions and disks

Disk OID's

Path where the disk is mounted: .1.3.6.1.4.1.2021.9.1.2.1
Path of the device for the partition: .1.3.6.1.4.1.2021.9.1.3.1
Total size of the disk/partion (kBytes): .1.3.6.1.4.1.2021.9.1.6.1
Available space on the disk: .1.3.6.1.4.1.2021.9.1.7.1
Used space on the disk: .1.3.6.1.4.1.2021.9.1.8.1
Percentage of space used on disk: .1.3.6.1.4.1.2021.9.1.9.1
Percentage of inodes used on disk: .1.3.6.1.4.1.2021.9.1.10.1

System Uptime: .1.3.6.1.2.1.1.3.0

Saturday, September 13, 2014

Interview questions.

Networking interview questions.
1. Benefits of OSPF over RIP?
2. What will happen when a new switch boots?
3. Why VLAN is required?
4. How STP works?
5. Why Area 0 is required in OSPF conecpt?
6, ARP purpose.

Sip interview questions:

1.What do you mean by a sip session?
2. explain a simple call flow
3.Draw the call flow for music on hold
4.What is the use of address of record in REGISTER messages.
5.what is record route.
6.Difference between strict routing and loose routing.
7.stateless, stateful and superstateful proxies.
8.what all components are used in a call.

9.use of contact header.
Answer:

The Contact header field describes the SIP or SIPS URI that the originating UA can be contacted at. This is used  both in a request establishing a dialog, registrations and redirects. The Contact header must be present in INVITE messages and be globally unique and accessible. 


10.difference of usage of contact header and connection information in SDP.
Answer:

The  c= field  contains  information  about  the  media  connection.  The  field contains: c=network-type address-type connection-address. The network-type parameter is defined as IN for the Internet. The address type  is  defined  as   IP4 for  IPv4  addresses,  IP6 for  IPv6  addresses.  The  connection-address is the IP address that will be sending the media packets, which could  be  either  multicast  or  unicast.  If  multicast,  the  connection-address  field contains:connection-address=base-multicast-address/ttl/number-of- addresses where ttlis the time-to-live value, and number-of-addressesindicateshow  many  contiguous  multicast  addresses  are  included  starting  with  the base-multicast-address.



11.Use of subscribe and Notify. Real time example.
Answer:

NOTIFY requests simply relay information related to the configured event package to the subscriber.  Since there is no SIP call state change, the subscriber usually responds with a “200 OK”.  There are a few situations in which a subscriber  may want to respond to a NOTIFY request with something other than a “200 OK” response message; those  situations  are  considered  error  states  and  are  not  part  of  this  particular  test.      This  test  requires  that  theNOTIFY request be part of the same dialog that the initial SUBSCRIBE request created.  Since this group of tests explicitly  evaluates  the  SUBSCRIBE/NOTIFY  functionality,  and  therefore  assumes  that  the  subscription  state  is installed via a SUBSCRIBE request.  It is possible that the subscription state would be established out of band, in which case the NOTIFY message would NOT be part of a dialog.

USAGE: Automatic call back


12.Explain Attended Transfer?
13.what is early media and why it is needed?
Answer:

Early media is used to avoid voice slicing. Basically with ISDN to sip gateways , a media path will be established before 200 OK. So the caller at the sip side will get access to any informations like call busy tones, network busy tones. Also this helps to avoid voice chopping because the caller may start to speak without the actual start of the session.


14.What is delayed media?
Answer:

Media negotiation happens in 200 Ok.
Usage: Music on Hold Scenarios


15.DNIS, DID and ANI-details?
Answer:

DNIS: Dialed Number Information Service.
DID: Direct Inward Dialing--> Number used for Dialing.
ANI: Caller ID


16.RTP, RTCP. How Voice Quality metrics are measured.
17.How will you put a call on HOLD? the methods and their explanation.
18.what is DTMF buffer?
19.How will you debug a sip call. What all parameters you will look on.
20.What are the parameters you configure in a gateway?


Reasoning questions:
1. http://brainteaserbible.com/interview-brainteaser-matches-in-a-knockout-tournament
2. http://datagenetics.com/blog/july22012/index.html