Page 1 of 2

[solved] SNMP Hikvision

Posted: Wed Aug 29, 2018 8:44 am
by Seppelchen
Hello,
I try to get information by snmp from hikvision recorder. I enable SNMP v2 on hikvision and add that service:

Code: Select all

###########################
# HIKVISION SNMP CHECK
###########################
#
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       Hikvision-Klar
        service_description             Hikvision Type
        notifications_enabled           0
        normal_check_interval           60
        check_command                   check_snmp!-C public -o .1.3.6.1.4.1.50001 -m ALL
        }
I also Upload that file HIKVISION-MIB.txt info: /usr/share/snmp/mibs
On that page I download that file: https://github.com/pgmillon/observium/b ... VISION-MIB
...but it seems not working I get error message.

Could someone help me and tell how I need do it?

Best,
Seppelchen

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 9:23 am
by scottwilkerson
What error do you receive?

Do you get a response when running the following from the command line?

Code: Select all

snmpwalk -c public -v 2c YOUR_HOST .1.3.6.1.4.1.50001

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 9:29 am
by Seppelchen
Hi if i put your command i get:

Code: Select all

SNMPv2-SMI::enterprises.50001.1.1.0 = IpAddress: 192.168.248.31
SNMPv2-SMI::enterprises.50001.1.2.0 = INTEGER: 8001
SNMPv2-SMI::enterprises.50001.1.3.0 = STRING: "1620170912CCRR831423499WCVU"
SNMPv2-SMI::enterprises.50001.1.100.0 = INTEGER: 2
SNMPv2-SMI::enterprises.50001.1.101.0 = INTEGER: 200
SNMPv2-SMI::enterprises.50001.1.102.0 = INTEGER: 1
SNMPv2-SMI::enterprises.50001.1.103.0 = INTEGER: 255
SNMPv2-SMI::enterprises.50001.1.104.0 = INTEGER: 255
SNMPv2-SMI::enterprises.50001.1.105.0 = INTEGER: 0
SNMPv2-SMI::enterprises.50001.1.106.0 = ""
SNMPv2-SMI::enterprises.50001.1.110.0 = ""
SNMPv2-SMI::enterprises.50001.1.200.0 = INTEGER: 1
SNMPv2-SMI::enterprises.50001.1.201.0 = STRING: "1000MHZ"
SNMPv2-SMI::enterprises.50001.1.220.0 = INTEGER: 500
SNMPv2-SMI::enterprises.50001.1.221.0 = INTEGER: 2
SNMPv2-SMI::enterprises.50001.1.230.0 = INTEGER: 1
SNMPv2-SMI::enterprises.50001.1.231.0 = INTEGER: 6
SNMPv2-SMI::enterprises.50001.1.240.0 = INTEGER: 1
SNMPv2-SMI::enterprises.50001.1.241.1.1.1.0 = INTEGER: 1
SNMPv2-SMI::enterprises.50001.1.241.1.2.1.0 = STRING: "lable01"
SNMPv2-SMI::enterprises.50001.1.241.1.3.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.50001.1.241.1.4.1.0 = INTEGER: 156672
SNMPv2-SMI::enterprises.50001.1.241.1.5.1.0 = INTEGER: 476940
SNMPv2-SMI::enterprises.50001.1.241.1.5.1.0 = No more variables left in this MIB View (It is past the end of the MIB tree)
Did I need upload that mib file? Or that is not important that mib file?

Could you please tell right command? :(

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 9:55 am
by scottwilkerson
The mib is not important if you have the full OID, however, the command I had you run doesn't show a value at .1.3.6.1.4.1.50001 it only shows values at something under that, you need to change the OID to the exact path for the item you are trying to monitor, such as

.1.3.6.1.4.1.50001.1.241.1.4.1.0

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 10:26 am
by Seppelchen
Hi, it looks now better BUT
I get that response:
SNMP OK - 2

Because that field could be for example: INTEGER: 2

If It is is possible to transfer that INTEGER to a word if i know what is 1 , 2 or 3?

For Example
1 == DVR
2 == NVR
3 == unknown

Could I display NVR insted of 2?

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 10:44 am
by scottwilkerson
You would need to write your own custom plugin to do this.

Here are the Nagios Plugin Development Guidelines
https://nagios-plugins.org/doc/guidelines.html

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 10:48 am
by Seppelchen
Hi that seems really hard. You not have any example for custom snmp plugin?:(

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 11:22 am
by scottwilkerson
There are just over 4300 different examples on the Nagios Exchange in the plugin section
https://exchange.nagios.org/

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 1:21 pm
by Seppelchen
Thanks for that link I also find some sh examples but I not understand :(
Normally that script need only use that oid and than change that output to some of my variables. Could you maybe help some ?:(

Re: SNMP Hikvision

Posted: Wed Aug 29, 2018 1:49 pm
by scottwilkerson
We can write custom plugins for users, it would fall under custom development, which you would have to contact our sales department for aquote, they generally start at $4000 US

Contact [email protected]