Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Sat May 21, 2022 3:44 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: add MIB for Switch
PostPosted: Wed Jul 26, 2017 5:04 pm 
Offline
Newbie

Joined: Wed Jul 26, 2017 4:27 pm
Posts: 22
Hi,

On a discovery of a switch with snmp, somefields are not recognized as the serial number or the model.

I've download from the manufacturer the MIB for Hirschmann switchs.
Is it possible to add it to Open Audit code (OID's)?

Thank you


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Thu Jul 27, 2017 7:25 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
Post the MIB here and I'll take a look. Should be simple enough.

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Thu Jul 27, 2017 6:02 pm 
Offline
Newbie

Joined: Wed Jul 26, 2017 4:27 pm
Posts: 22
[code]HIRSCHMANN-DISCOVERY-MGMT-MIB DEFINITIONS ::= BEGIN

IMPORTS
MODULE-IDENTITY, OBJECT-TYPE FROM SNMPv2-SMI
MacAddress FROM SNMPv2-TC
SnmpAdminString FROM SNMP-FRAMEWORK-MIB
InetAddressType,
InetAddress,
InetAddressPrefixLength
FROM INET-ADDRESS-MIB
hmManagement FROM HIRSCHMANN-MGMT-MIB;

hmMgmtDiscoveryGroup MODULE-IDENTITY
LAST-UPDATED "201407071200Z" -- 07 Jul 2014 12:00:00 GMT
ORGANIZATION "Hirschmann Automation and Control GmbH"
CONTACT-INFO
"Postal: Stuttgarter Str. 45-51
72654 Neckartenzlingen
Germany
Phone: +49 7127 140
E-mail: hac.support@belden.com"
DESCRIPTION
"The Hirschmann generic discovery SNMP MIB.
Copyright (C) 2014. All Rights Reserved."
REVISION "201407071200Z" -- 07 Jul 2014 12:00:00 GMT
DESCRIPTION
"Initial version."
::= { hmManagement 100 }


--
-- *************************************************************
-- hmMgmtDiscoveryGroup groups
-- *************************************************************
--

hmMgmtDiscoveryStatusGroup OBJECT IDENTIFIER ::= { hmMgmtDiscoveryGroup 1 }
hmMgmtDiscoveryCfgGroup OBJECT IDENTIFIER ::= { hmMgmtDiscoveryGroup 2 }

--
-- *************************************************************
-- hmMgmtDiscoveryStatusGroup
-- *************************************************************
--
hmMgmtDiscMode OBJECT-TYPE
SYNTAX INTEGER {
read-write(1),
read-only(2)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Operational mode of the protocol."
::= { hmMgmtDiscoveryStatusGroup 1 }

hmMgmtDiscMacAddr OBJECT-TYPE
SYNTAX MacAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Physical base address (MAC address) of the agent.
This is the burned in MAC address from the production."
::= { hmMgmtDiscoveryStatusGroup 2 }

hmMgmtDiscIpIntfType OBJECT-TYPE
SYNTAX INTEGER
{
loopback-intf (1),
router-intf (2),
mgmt-intf (3)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The interface which reports the ip settings."
::= { hmMgmtDiscoveryStatusGroup 3 }

hmMgmtDiscSwVersion OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Version of the currently running firmware."
::= { hmMgmtDiscoveryStatusGroup 4 }

hmMgmtDiscProductDescr OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Manufacturer-defined product description."
::= { hmMgmtDiscoveryStatusGroup 5 }

--
-- *************************************************************
-- hmMgmtDiscoveryCfgGroup
-- *************************************************************
--
hmMgmtDiscCfgUUID OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The UUID of the device used for the discovery protocol."
::= { hmMgmtDiscoveryCfgGroup 1 }

hmMgmtDiscCfgProto OBJECT-TYPE
SYNTAX INTEGER {
none(1),
bootp(2),
dhcp(3)
}
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The switch's network configuration protocol.
The default value is dependent of the device type."
::= { hmMgmtDiscoveryCfgGroup 2 }

hmMgmtDiscCfgIPAddrType OBJECT-TYPE
SYNTAX InetAddressType
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Local IP address type."
::= { hmMgmtDiscoveryCfgGroup 3 }

hmMgmtDiscCfgIPAddr OBJECT-TYPE
SYNTAX InetAddress
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"IP address of the management agent board.
Changing this value will take effect after activating
with hmMgmtDiscCfgAction."
::= { hmMgmtDiscoveryCfgGroup 4 }

hmMgmtDiscCfgPrefLen OBJECT-TYPE
SYNTAX InetAddressPrefixLength
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The length of the IP netmask."
::= { hmMgmtDiscoveryCfgGroup 5 }

hmMgmtDiscCfgGwIPAddrType OBJECT-TYPE
SYNTAX InetAddressType
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Default gateway IP address type."
::= { hmMgmtDiscoveryCfgGroup 6 }

hmMgmtDiscCfgGwIPAddr OBJECT-TYPE
SYNTAX InetAddress
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"IP address of the default gateway.
Changing this value will take effect after activating
with hmMgmtDiscCfgAction."
::= { hmMgmtDiscoveryCfgGroup 7 }

hmMgmtDiscCfgAction OBJECT-TYPE
SYNTAX INTEGER {
other (1),
activate (2)
}
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This object, when read, always returns a value of other(1).
Setting the object to activate(2) causes a reconfiguration
of the IP protocol stack."
DEFVAL { other }
::= { hmMgmtDiscoveryCfgGroup 8 }

hmMgmtDiscCfgBlinking OBJECT-TYPE
SYNTAX INTEGER
{
enable(1),
disable(2)
}
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Enables/disables the HiDiscovery blinking sequence
on this device. This object will not be saved."
DEFVAL { disable }
::= { hmMgmtDiscoveryCfgGroup 9 }

END


[/code]


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Sat Jul 29, 2017 7:24 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Could you also post the contents of HIRSCHMANN-DISCOVERY-MGMT-MIB?


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Mon Jul 31, 2017 4:56 am 
Offline
Newbie

Joined: Wed Jul 26, 2017 4:27 pm
Posts: 22
this is the content of the mib


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Mon Jul 31, 2017 6:14 pm 
Offline
Newbie

Joined: Wed Jul 26, 2017 4:27 pm
Posts: 22
I have several MIB to add, can i do it myself ?


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Wed Aug 02, 2017 6:35 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
It's open source so yes. It's not exactly non-developer friendly. The MIB you posted is dependent on another MIB for some of the details needed to get this to work.

I searched and found various MIBs for Hirschmann (Vendor ID 248) switches that shows the info you would need.

Quick info: snmp_audit in snmp_helper.php performs the snmp audit and it's a fairly long function. It tries the usual OIDs for info and also grabs the vendor ID and calls out to vendor specific snmp_helper scripts.

So you can't just drop a MIB in a directory and you'd need more info that provided in that MIB to get OpenAudit to pull the data.

Not sure where Mark will put this on the development list and I can't speak for Opmantek as I'm just another user.


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Wed Aug 02, 2017 8:16 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
I'll add the attributes straight away - when we have the correct OIDs to query.
As JPA said, this MIB doesn't provide them.
Find me the MIB that does (even better - get me the OIDs), and I'll add them in 5 minutes.
And if you ask really nice, I'll even provide you a patch so you don't need to wait for the next release :-)

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Wed Aug 02, 2017 6:20 pm 
Offline
Newbie

Joined: Wed Jul 26, 2017 4:27 pm
Posts: 22
I found two mib and I think that they are the good ones.. Well i hope so :D


Attachments:
MIB Hirschmann.zip [109.4 KiB]
Downloaded 331 times
Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Wed Aug 09, 2017 12:21 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
I haven't managed to get the serial sorted, but this file should at least tell you what the product model is.
Put it into open-audit\code_igniter\application\helpers\snmp_248_helper.php (rename it from .txt).


Attachments:
snmp_248_helper.txt [5.49 KiB]
Downloaded 320 times

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.
Top
 Profile  
Reply with quote  
 Post subject: Re: add MIB for Switch
PostPosted: Thu Aug 10, 2017 4:17 pm 
Offline
Newbie

Joined: Wed Jul 26, 2017 4:27 pm
Posts: 22
Thank's Mark for your work, it works well.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group