Mib generation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Mib generation

Nyirő Gergő
Dear list,

I try to write a simple snmp agent, which could expose the status of the registered systemd services.

The application config would contain a map of the required service name to the exported oids. I would like to generate a mib file from this oid list.

Parsing a mib file seams an easy task in erlang, but I didn't find example for generating mib file.
Does anyone have any experience with mib generation with erlang?

Thanks for any advice in advance,
Gergo
Reply | Threaded
Open this post in threaded view
|

Re: Mib generation

Dániel Szoboszlay
Hi,

I don't think there would be much tooling in Erlang for generating MIBs on the fly. I guess the standard way of solving this kind of problem is to write (manually) a static MIB that lists all dynamic information in tables. E.g. you could create a service status table where the key is the service name, and there are columns for each property to show about a service. Or, if there are dynamic properties, you could put them into a second table keyed with the service name and the property name (just like how you would store the data in a SQL DB).

If you'd like to generate the MIB on the fly, you'd probably have to write the code for that on your own. But it doesn't seem to be very hard to do on top of some templating library like ErlyDTL or Mustache.

Cheers,
Daniel


On Mon, 9 Mar 2020 at 23:18, Nyirő Gergő <[hidden email]> wrote:
Dear list,

I try to write a simple snmp agent, which could expose the status of the registered systemd services.

The application config would contain a map of the required service name to the exported oids. I would like to generate a mib file from this oid list.

Parsing a mib file seams an easy task in erlang, but I didn't find example for generating mib file.
Does anyone have any experience with mib generation with erlang?

Thanks for any advice in advance,
Gergo
Reply | Threaded
Open this post in threaded view
|

RE: Mib generation

Gergely Buday
In reply to this post by Nyirő Gergő

http://www.snmplink.org/software/fordeveloper/#1

 

contains links to MIB software. Are those useful for your project?

 

-          Gergely

 

From: erlang-questions <[hidden email]> On Behalf Of Nyirő Gergő
Sent: Monday, March 9, 2020 11:18 PM
To: erlang-questions <[hidden email]>
Subject: Mib generation

 

Dear list,

 

I try to write a simple snmp agent, which could expose the status of the registered systemd services.

 

The application config would contain a map of the required service name to the exported oids. I would like to generate a mib file from this oid list.

 

Parsing a mib file seams an easy task in erlang, but I didn't find example for generating mib file.

Does anyone have any experience with mib generation with erlang?

 

Thanks for any advice in advance,

Gergo

Reply | Threaded
Open this post in threaded view
|

Re: Mib generation

Nyirő Gergő
Thanks for the link, it's quite a good collection.
I'm looking for a CLI tool or library which could be invoked into an
automated deployment (not found yet).

--
Gergo

On Tue, Mar 10, 2020 at 10:44 AM Gergely Buday
<[hidden email]> wrote:

>
> http://www.snmplink.org/software/fordeveloper/#1
>
>
>
> contains links to MIB software. Are those useful for your project?
>
>
>
> -          Gergely
>
>
>
> From: erlang-questions <[hidden email]> On Behalf Of Nyirő Gergő
> Sent: Monday, March 9, 2020 11:18 PM
> To: erlang-questions <[hidden email]>
> Subject: Mib generation
>
>
>
> Dear list,
>
>
>
> I try to write a simple snmp agent, which could expose the status of the registered systemd services.
>
>
>
> The application config would contain a map of the required service name to the exported oids. I would like to generate a mib file from this oid list.
>
>
>
> Parsing a mib file seams an easy task in erlang, but I didn't find example for generating mib file.
>
> Does anyone have any experience with mib generation with erlang?
>
>
>
> Thanks for any advice in advance,
>
> Gergo
Reply | Threaded
Open this post in threaded view
|

Re: Mib generation

Nyirő Gergő
In reply to this post by Dániel Szoboszlay
Thanks for the advice. It made me think to get the mib file granted
and describe the systemd services and their oids in a separated
config,
so I only have to validate that the mib contains the required oid with
a proper type.
In this way the monitored systemd service can be renamed without any
change on the exposed mib file.

--
Gergo

On Tue, Mar 10, 2020 at 10:40 AM Dániel Szoboszlay
<[hidden email]> wrote:

>
> Hi,
>
> I don't think there would be much tooling in Erlang for generating MIBs on the fly. I guess the standard way of solving this kind of problem is to write (manually) a static MIB that lists all dynamic information in tables. E.g. you could create a service status table where the key is the service name, and there are columns for each property to show about a service. Or, if there are dynamic properties, you could put them into a second table keyed with the service name and the property name (just like how you would store the data in a SQL DB).
>
> If you'd like to generate the MIB on the fly, you'd probably have to write the code for that on your own. But it doesn't seem to be very hard to do on top of some templating library like ErlyDTL or Mustache.
>
> Cheers,
> Daniel
>
>
> On Mon, 9 Mar 2020 at 23:18, Nyirő Gergő <[hidden email]> wrote:
>>
>> Dear list,
>>
>> I try to write a simple snmp agent, which could expose the status of the registered systemd services.
>>
>> The application config would contain a map of the required service name to the exported oids. I would like to generate a mib file from this oid list.
>>
>> Parsing a mib file seams an easy task in erlang, but I didn't find example for generating mib file.
>> Does anyone have any experience with mib generation with erlang?
>>
>> Thanks for any advice in advance,
>> Gergo