Setting EngineID in Cacti

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
kiler129
Posts: 1
Joined: Sat Apr 08, 2017 10:09 pm

Setting EngineID in Cacti

Post by kiler129 »

Hi,

First of thank you for creating and maintaining such an awesome project!

I started playing with cacti to graph my routers and discovered a slight problem with fetching data: there's no way to set EngineID (or I'm blind). I searched a lot about that and even found one post on the forum saying that it's not supported. Currently my test box is running Debian 8, Apache 2, PHP 5.6.30 and cacti 0.8.8b (everything installed from repo).

All of my devices are running MikroTik RouterOS and using SNMPv3 they're reporting constantly "v3 err: 3 unknown engine id".
While graphs are working I will like to get rid of these messages. I'm assuming that the only thing to make them happy is to set EngineID on the client side.

I'm experienced PHP developer, so I've tried to first debug the problem and manually query SNMP server hoping for something. First I discovered that snmp3_get() has no support for EngineID, so I used \SNMP class:

Code: Select all

$snmp = new SNMP(3, 'host:port', 'community');
$snmp->setSecurity(
        'authPriv',
        'SHA',
        'AUTH_PW',
        'AES',
        'ENC_PW',
        '',
        'EngineID'
);

$x = $snmp->get('OID');
var_dump($x);
While code above returned useful result (unlike snmp3_get()) router still complains about missing EngineID. I've found following in RouterOS documentation:
engine-id (string; Default: "") for SNMP v3, used as part of identifier. You can configure suffix part of engine id using this argument. If SNMP client is not capable to detect set engine-id value then this prefix hex have to be used 0x80003a8c04
Note: engine-id field holds the suffix value of engine-id, usually SNMP clients should be able to detect the value, as SNMP values, as read from the router. However there is a possibility that this is not the case. In which case, the engine-ID value has to be set according to this rule: <engine-id prefix> + <hex-dump suffix>, so as an example, if you have set 1234 as suffix value you have to provide 80003a8c04 + 31323334, combined hex (the result) is 80003a8c0431323334
I tried using both 0x80.... form as well as 80.... - results were exactly the same.
Interestingly enough using snmpwalk produces no errors in router log:

Code: Select all

snmpwalk -u COMMUNITY -v 3 -a SHA -A AUTH_PWD -l authPriv -x AES -X ENC_PWD -M Mikrotik.mib HOST:PORT
Obviously you guys have a lot more experience with SNMP than me - can you suggest something? If there's a solution but there's no time to implement it I will be more than happy to help with that :)
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Setting EngineID in Cacti

Post by Osiris »

Engine ID is 'very' optional. Keep it blank and make sure your clocks are synced.
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest