Zabbix for Beginners- 03- Working with Zabbix - Part 2 - Templates with SNMP

Previous videos:
00-Introduction, what do we do in this series
01-Installing Zabbix and its pre-requirements
02-Working with Zabbix-Part 1
  • Zabbix Architecture and components 
  • How Zabbix monitors network devices one-by-one, item-by-item, using SNMP 
  • Host, Items, Graphs, Actions, etc. 
 This video:
  • Disadvantages of using fix SNMP OID 
  • What the Zabbix Templates are and why Templates? 
  • Using Templates – SNMP 
You can watch the video here: http://youtu.be/uL2ifZwYRnA

You can download the slide here: https://drive.google.com/file/d/0B7Qqqz58v3OKVldVNUUzOWtrMDg/view?usp=sharing




So far, we can monitor Network Devices, like Routers and Switches, by using SNMP OID which we have to find for all resource we want to monitor.
Example: Each interface should have at least two Items incoming and outgoing traffic. So, for a 48-ports switch we have to create 48×2=96 Items. What should we do for a large enterprise with 500 switches? 96×500=48000 Items should be inserted, manually!!!!!!

Templates
A template is a set of entities that can be conveniently applied to multiple hosts. Entities like Items, Triggers, Graphs
for more information: https://www.zabbix.com/documentation/2.4/manual/config/templates

You can use the default and pre-installed Templates or you can download some Templates from http://www.zabbix.org/wiki/Zabbix_Templates

 Source: http://www.cartoonsolutions.com/store/catalog/Flash-Templates-sp-82.html

 Also you can create new Templates

There are several types of Templates, but we will use Templates which have been prepared for SNMP Using Templates

Example: R1 should use some Templates which uses SNMP. So add Template SNMP Device and then Add {$SNMP_COMMUNITY}=𝐜𝐛𝐭𝟒𝐚𝐥𝐥 in macro tab.
It means use the given string (here cbt4all) as SNMP Community String for all items

You can also edit the Templates if you need more Templates. For example SNMP Device dose not have CPU and Memory Load and Template SNMP Processors have no Item by default

 Install SNMP for Linux Server
  • sudo apt-get update
  • sudo apt-get install snmpd snmp 
  • Edit configuration file: sudo vi /etc/snmp/snmpd.conf and Comment : #agentAddress udp:127.0.0.1:161 and then Uncomment: agentAddress udp:161,udp6:[::1]:161 
  • Add Community String: rocommunity cbt4all 
  • Restart the SNMP service: sudo service snmpd restart 
For more information:

Now install SNMP for Windows Server and add it to Zabbix. In this video I use Windows 2012 Server, but you can do it in any edition of the Windows

Now we can monitor Network Devices, like Routers and Switches and Servers like Linux Servers and Windows Servers by using SNMP and Templates, but what if we don’t want to use SNMP? In next video I will show you how you can use the Zabbix Agent in Zabbix to monitor servers easy!

15 comments:

Anonymous said...

great resources. thank you for your work.
Stefano

fa-golangtraining said...

@Stefano
Thanks for your comment. I hope the series are useful

Unknown said...

hi Mr Alireza
Thanks for tutorial
I want to create a new SANMP OID. Can you help me please.

Unknown said...

Hi
I want to definition an OID for monitor ZFS file system, can you help me,Please?

The Best Regards,

fa-golangtraining said...

@Hesam,

Hi, to be honest, I have no idea! I will keep it in my mind for the future to research about it.

Sorry!

Unknown said...

Hi Alireza
I found your videos very helpful. I've installed Zabbix server and agent on the same linux machine. I've created a host and an item for CPU load, but I don't see any data in graph. Please help me.

fa-golangtraining said...

@Akanksha
Hi. Thanks for your comment. Actually I think you need to watch the series from scratch because you wont need to install both Zabbix server and client on a Host. You need to have one server, Zabbix server, and other machines are your client. Also, when you install Zabbix Server, it will install Zabbix Agent automatically on the server as well. So, you will find it in host and it is required to re-add the host.

I still recommend you to watch the series first and do step by step.

Unknown said...

Hi Alireza,
First of all,I would like to thank you for these tutos, the were very helpful.
However, I've two problems that I couldn't solve:
1) I've installed SNMP on ubuntu VM 14.04 and I've done all the necessary changes then I've created a host related to this VM and I've matched the Template "SNMP OS Linux" and I've got snmp's symbol green, so I thought everything is okay, but when I wanted to monitor network in my interfaces, Template SNMP Interfaces: Number of network interfaces ==> Not supported with error msg (no such object available on this agent at this OID).
2)I don't know if it's the right place for this question, but I've problem in configuring actions for triggers especially in configuring the media type (email).
would you please help me solve these two problems !!
Thks a lot :)

fa-golangtraining said...

@Sirine

Thanks for you comment and I am happy to see that the videos are helpful

1) Well, I have no idea! I have not seen the error before. Are you sure you have followed the video? Because I have created SNMP on Linux several time and I have never got the problem.
2) For this problem I have another video and tried to explained very easy. Please take a look on :
http://www.cbt4all.com/2015/04/zabbix-for-beginners-05-working-with.html

Unknown said...

hello . thinks for your lesson . can you send me the snmp oid list .

fa-golangtraining said...

@Jamal
Thanks for your comment. There are two types of SNMP OID. The first one which is common has been mentioned in the video. The second type which is related to each device and is not common between network device, should be provided via vendor.
Cheers

Anonymous said...

Hi,

found your videos and it's really helpful for me.
do you have tutorial for create templates in zabbix to read csv file?
thanks

fa-golangtraining said...

@Anonymous
Sorry for the delayed respond. No I don't have any. Perhaps in the future I create some. :(

ZabbixBBT said...

Hi,

I am try install postfix in zabbix server, we already follow step by step like this in your video. But I am can not succes try install ssl certs.
From step one until step three the result is good. I am can not do step 4

1.sudo postmap hash:/etc/postfix/sasl_passwd
2.sudo chown root:root /etc/postfix/sasl_passwd
3.sudo chmod 600 /etc/postfix/sasl_passwd
4.cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
5.sudo /etc/init.d/postfix reload

Below error if I am execute step 4.

root@ubuntu:/etc/postfix# cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
cat: /etc/ssl/certs/Thawte_Premium_Server_CA.pem: No such file or directory
root@ubuntu:/etc/postfix#

Satish Singh said...

Hello Sir,
I want to add a custom item. Which will be like Total Memory - Available Memory = Used Memory

what is the item key formate

please help me