zabbix-tools / mib2zabbix

SNMP Template generator for Zabbix
183 stars 77 forks source link

Zabbix 2.4 Template Schema Support #3

Open akayueh opened 8 years ago

akayueh commented 8 years ago

Hi Ryan

I have uploaded a version of your mib2zabbix to support v.24 template schema, feel free to merge it to your master copy. It is not the cleanest but it does the job.

https://github.com/akayueh/mib2zabbix

Steven

akayueh commented 8 years ago

Will need to work on the OID for the LLD items, will let you know when I fixed this issue.

cavaliercoder commented 8 years ago

Thanks very much for submitting this. I'm happy to include your changes if you can please raise a Pull request. I will ask that you please only submit the changes that are relevant to this feature. I.e. undo any changes to code formatting/indentation for unrelated code and remove any of the XML::Simple 2.20 fix stuff. These things should be addressed in discrete pull requests.

akayueh commented 8 years ago

Let me work on my fork with the OID for 2.4 first, the I will do a pull request. Want to keep as clean as possible.

Regards

Steven

On Thursday, 18 August 2016, Ryan Armstrong notifications@github.com wrote:

Thanks very much for submitting this. I'm happy to include your changes if you can please raise a Pull request. I will ask that you please only submit the changes that are relevant to this feature. I.e. undo any changes to code formatting/indentation for unrelated code and remove any of the XML::Simple 2.20 fix stuff. These things should be addressed in discrete pull requests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cavaliercoder/mib2zabbix/issues/3#issuecomment-240654314, or mute the thread https://github.com/notifications/unsubscribe-auth/ADzGCQMNdUleYVi3wka26wiZ6su6CCS-ks5qhBQfgaJpZM4JnKIy .

Steven Yu

"And you will know the truth, and the truth will set you free", John 8:32 "你們必定認識真理,真理必定使你們自由", 約翰福音 8:32

akayueh commented 8 years ago

Hi Ryan

I think the LLD algorithm is wrong with the script, and I don't know whether it will work in v3 of Zabbix with the new macro support either. (based on the v2 export option, my template doesn't seem to carry any of the LLD related macros)

I will use the following OID from Doremi MIB as an example.

dcpSENfansTable .1.3.6.1.4.1.24391.4.1.3.3.1.1 -dcpSENfansEntry .1.3.6.1.4.1.24391.4.1.3.3.1.1.1 --dcpFANIndex .1.3.6.1.4.1.24391.4.1.3.3.1.1.1.1 --dcpFANTitle .1.3.6.1.4.1.24391.4.1.3.3.1.1.1.2 --dcpFANWorkingState .1.3.6.1.4.1.24391.4.1.3.3.1.1.1.3 --dcpFANValue .1.3.6.1.4.1.24391.4.1.3.3.1.1.1.4 --dcpFANLowThreshold .1.3.6.1.4.1.24391.4.1.3.3.1.1.1.5 --dcpFANHighThreshold .1.3.6.1.4.1.24391.4.1.3.3.1.1.1.6

Current version of the script generated the following layers in the LLD:

- dcpSENfansEntry discovery[{#DCPFANHIGHTHRESHOLD},.1.3.6.1.4.1.24391.4.1.3.3.1.1.1.6,{#DCPFANLOWTHRESHOLD},.1.3.6.1.4.1.24391.4.1.3.3.1.1.1.5,{#DCPFANVALUE},.1.3.6.1.4.1.24391.4.1.3.3.1.1.1.4,{#DCPFANWORKINGSTATE},.1.3.6.1.4.1.24391.4.1.3.3.1.1.1.3] -- dcpFANHighThreshold for {#SNMPINDEX} -- dcpFANIndex for {#SNMPINDEX} -- dcpFANLowThreshold for {#SNMPINDEX} -- dcpFANTitle for {#SNMPINDEX} -- dcpFANValue for {#SNMPINDEX} -- dcpFANWorkingState for {#SNMPINDEX}

But in order for the LLD to work, the layout should be:

- dcpSENfansTable discovery (.1.3.6.1.4.1.24391.4.1.3.3.1.1.1.1) <-- OID of dcpFANIndex -- dcpFANHighThreshold for {#SNMPINDEX} (dcpFANIndex) -- dcpFANLowThreshold for {#SNMPINDEX} (dcpFANIndex) -- dcpFANTitle for {#SNMPINDEX} (dcpFANIndex) -- dcpFANValue for {#SNMPINDEX} (dcpFANIndex) -- dcpFANWorkingState for {#SNMPINDEX} (dcpFANIndex)

Happy to discuss

Steven

cavaliercoder commented 8 years ago

Thanks Steven. The key format for SNMP discoveries have changed in v3: https://www.zabbix.com/documentation/3.0/manual/discovery/low_level_discovery#discovery_of_snmp_oids

Admittedly this will break v2, but I deliberately discontinued v2 support given the lack of interest. Maybe this was a bad decision.

akayueh commented 8 years ago

no worries, I will see what I can do.

On 19 August 2016 at 15:12, Ryan Armstrong notifications@github.com wrote:

Thanks Steven. The key format for SNMP discoveries have changed in v3: https://www.zabbix.com/documentation/3.0/manual/ discovery/low_level_discovery#discovery_of_snmp_oids

Admittedly this will break v2, but I deliberately discontinued v2 support given the lack of interest. Maybe this was a bad decision.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cavaliercoder/mib2zabbix/issues/3#issuecomment-240929621, or mute the thread https://github.com/notifications/unsubscribe-auth/ADzGCXI54RtumS-3d_cxIqUqvFMYBFWYks5qhTtGgaJpZM4JnKIy .

Steven Yu

"And you will know the truth, and the truth will set you free", John 8:32 "你們必定認識真理,真理必定使你們自由", 約翰福音 8:32

akayueh commented 8 years ago

HI Ryan

I have submit a pull request for the changes I made, please review.

Thanks for your inital work,, it will save me heaps of time in creating various templates for different devices in my moniotoring work.

Regards

Steven

akayueh commented 7 years ago

Hi Ryan

Did you have a chance to review the changes I made for the 2.4 pull?

Regards

Steven

cavaliercoder commented 7 years ago

Yes, briefly. Apologies for the delay. I have been travelling to Zabbix Conference and moving house once I returned. I only having fleeting access to the Internet!

I'm happy to accept your PR but noticed there are still a few 'stylistic' and formatting changes to please undo. I've added comments to #5.

akayueh commented 7 years ago

Sorry, I am not sure about the request is it adding a new line where you indicated or you have removed the line already.

As I can't find the extra new line, I have add them in.

cavaliercoder commented 7 years ago

Okay no problem. I'll patch it up shortly and accept. Etiquette on GitHub is to keep pull requests as specific and discrete as possible, so please be careful not to bundle in changes like this in future. Thanks heaps for your contribution!

akayueh commented 7 years ago

Thanks, looking forward to watch your presentation on this year's Zabbix conference when they been uploaded to youtube.

On 17 October 2016 at 16:50, Ryan Armstrong notifications@github.com wrote:

Okay no problem. I'll patch it up shortly and accept. Etiquette on GitHub is to keep pull requests as specific and discrete as possible, so please be careful not to bundle in changes like this in future. Thanks heaps for your contribution!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cavaliercoder/mib2zabbix/issues/3#issuecomment-254118044, or mute the thread https://github.com/notifications/unsubscribe-auth/ADzGCf8ZsRjmmm0HSvbMUri87j4-_WJhks5q0wzAgaJpZM4JnKIy .

Steven Yu

"And you will know the truth, and the truth will set you free", John 8:32 "你們必定認識真理,真理必定使你們自由", 約翰福音 8:32