item_discovery
The following two tabs change content below.
Hi, I have written and developed this site to share my experience and ideas with other colleagues. I also started to prepare interview questions and answers for job seekers. I hope it will help you a lot.

Zabbix provide the support to many agents like zabbix/snmp/jmx etc. As now a days SNMP is very vast so I am using SNMP in this example.

For any kind of item monitoring in SNMP we need a OID (Object ID). In many cases OID can very from one environment to another or one manufacture company to other.

In this example we are discovering core cpu from window system so for that we have base OID:

hrProcessorLoad

OID: 1.3.6.1.2.1.25.3.3.1.2

Note: Before to work with OID please make sure SNMP is configure on particuler server and you should know SNMP COMMUNITY STRING.

Before to start with zabbix we can test SNMP connection using snmpwalk command. As given below

snmpwalk -v2c -c public <<HOSTNAME/IP Address>> 1.3.6.1.2.1.25.3.3.1.2

output:

snmpwalk output

If we got response as above that means out SNMP is good and we are able to make connection. if we haven’t get any response or like “No Response from host” that means there is some problem with SNMP connection to resolve that we need to connect with admin/network team.

 

How to setup discovery rule?

Discovery is a very good option to discover all sub objects from given oid (1.3.6.1.2.1.25.3.3.1.2).

1.I hope you done device onboarding already and you setup SNMP community string like below:

device_onborded

2. Now start discovery rule as given steps. Click on discovery rule button/link under the unboarded device.

discovery_rule_btn

after click on button below form will be open

discovery_rule_form

 

Now lets put the value in forms.

1. Name anything we can given. But best practice is name should be meaningful so I am using “CPU Discovery”

2. Choose the agent from where you want to discover the item as I mention we are using SNMP and version is 2 so choose SNMPV2 Agent.

3. Key: Key also we can give anything but key should be unique. I have used “cpu.discovery”

4. Host interface automatical will get selected you no need to worry.

5. SNMP OID: This is the field where we can given one or more base OID so base on that we can write multiple prototype items.

Given:

discovery[{#CORE_CPU},1.3.6.1.2.1.25.3.3.1.2]

6. SNMP COMMUNITY: this is the token which we are using for SNMP agent connection so use macro (Its a constant which already have value). like below

{$SNMP_COMMUNITY}

7. Update Interval : this is the interval means after how many time zabbix will rediscovery. I have used 30s for fast testing.

Other field you can use according to your requirement like how many day you want to keep history etc.

Note: There is option to avoid some un-necessary item to get created. For this purpose we can use filter as shown in below screenshot.

discovery_rule

 

8. Click add and now you seen discovery rule get created. But still it will not discover any item because for that we need to start itration using prototype item

 

How to create prototype item. Click on the prototype under discovery rule:

prototype_item

After click on the item prototype below form will get open and now lets complete and create prototype item.

  1. Name: give the name of item and index of object which will create main items after the discovery.                          Core #{#SNMPINDEX} Note: {#SNMPINDEX} is just like an index as we have in array.
  2. Type: Again choose “SNMPv2 Agent”
  3. Key: cpu.discovery[core.{#SNMPINDEX}]
  4. Host Interface : It will automatically bring it up.
  5. SNMP OID : 1.3.6.1.2.1.25.3.3.1.2.{#SNMPINDEX} Note: we have used <<BASE_OID>>.<<DYNAMIC INDEX>>
  6. SNMP COMMUNITY : {$SNMP_COMMUNITY}
  7. PORT: No need to fill just keep as its.
  8. Type of Information : This is just like a data type means if we know data from item is coming int/float or character so use according to that. Here we are using Numeric(Float)
  9. Units: Here we can give format like if we have to show data in “%” then we can use use.
  10. Update Interval: 30s (To poll new items after given interval)
  11. Other fields we can keep as its.

Note: Many time on discover item we have to do some calculation or some other operation for that we can use “Preprocessing” tab

preprocessing_on_item

Once we done with discovery rule/prototype item. After given time interval “ex: 30s we have given” real items get genrated like below:

main_items

For the created item we can check the latest value and see the grap also. Click Monitoring->Latest Data

latest_item_value

 

Every item on the right hand side click on “Graph” you can see graph of that item. And in grap we can watch the value of 1/2/3 hour/day/month according to our requirement. There is date/time filter given.

item_graph

 

Thats it. Please share your comment and feedback how you like this post or also let us know if you need any post in other area in zabbix.

81 total views, 2 views today

Leave a Reply

Your email address will not be published. Required fields are marked *