Skip to content

Commit

Permalink
Add discovered uptime field
Browse files Browse the repository at this point in the history
  • Loading branch information
Hipska committed Jun 21, 2024
1 parent ddd2544 commit ce4c6d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions datamodel.sv-snmp-discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<default_value/>
<is_null_allowed>true</is_null_allowed>
</field>
<field id="snmp_sysUptime" xsi:type="AttributeDuration" _delta="define">
<sql>snmp_sysuptime</sql>
<default_value/>
<is_null_allowed>true</is_null_allowed>
<tracking_level>none</tracking_level>
</field>
</fields>
<methods>
<method id="GetInitialStateAttributeFlags" _delta="define">
Expand All @@ -63,6 +69,7 @@
case 'snmp_sysDescr':
case 'snmp_sysContact':
case 'snmp_sysLocation':
case 'snmp_sysUptime':
$iFlags |= OPT_ATT_READONLY;
break;
}
Expand All @@ -84,6 +91,7 @@
case 'snmp_sysDescr':
case 'snmp_sysContact':
case 'snmp_sysLocation':
case 'snmp_sysUptime':
$iFlags |= OPT_ATT_READONLY;
break;
}
Expand Down Expand Up @@ -121,15 +129,18 @@
<item id="snmp_sysName">
<rank>40</rank>
</item>
<item id="snmp_sysDescr">
<item id="snmp_sysUptime">
<rank>50</rank>
</item>
<item id="snmp_sysContact">
<item id="snmp_sysDescr">
<rank>60</rank>
</item>
<item id="snmp_sysLocation">
<item id="snmp_sysContact">
<rank>70</rank>
</item>
<item id="snmp_sysLocation">
<rank>80</rank>
</item>
</items>
</item>
</items>
Expand Down Expand Up @@ -497,6 +508,7 @@
<entry id="Class:NetworkDevice/Attribute:snmp_sysDescr" _delta="define">sysDescr</entry>
<entry id="Class:NetworkDevice/Attribute:snmp_sysLocation" _delta="define">sysLocation</entry>
<entry id="Class:NetworkDevice/Attribute:snmp_sysName" _delta="define">sysName</entry>
<entry id="Class:NetworkDevice/Attribute:snmp_sysUptime" _delta="define">sysUptime</entry>
<entry id="Class:SNMPDiscovery" _delta="define">SNMP Discovery</entry>
<entry id="Class:SNMPDiscovery/Attribute:ipv4subnets_list" _delta="define">IPv4 Subnets</entry>
<entry id="Class:SNMPDiscovery/Attribute:ipv4subnets_list+" _delta="define">Subnets configured to be discovered by this application.</entry>
Expand Down
2 changes: 1 addition & 1 deletion module.sv-snmp-discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

SetupWebPage::AddModule(
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
'sv-snmp-discovery/1.1.0',
'sv-snmp-discovery/1.2.0',
array(
// Identification
//
Expand Down

0 comments on commit ce4c6d5

Please sign in to comment.