NMIS modelling uptime
This document explains the structure for defining system uptime monitoring through SNMP and RRD. The example uses “Common” model files so that the data can be easily added to any existing model, it also uses a “Custom” key at the end of the datasets because many models already define sysUpTime and some of them use different oids for this which NMIS does not like.
Create the file
Common-sysuptime.nmis
in themodels-custom
folder.Add
sysUpTimeCustom
Values to the File.
%hash = (
'database' => {
'type' => {
'sysUpTimeCustom' => '/nodes/$node/health/uptime.rrd',
}
},
'system' => {
'rrd' => {
'sysUpTimeCustom' => {
'graphtype' => 'sysuptime',
'snmp' => {
'sysUpTimeCustom' => {
'oid' => 'sysUpTime',
'title' => 'Uptime Days'
}
}
}
},
},
);
Select a model to add this data to. Copy that model to the models-custom folder, for example, copy Model-net-snmp.nmis
from models-default to models-custom
folder. In this case, add the ‘sysuptime'
key-value pair to the file into the ‘-common-’ section.
%hash = (
'-common-' => {
'class' => {
'database' => {
'common-model' => 'database'
},
'sysuptime' => {
'common-model' => 'sysuptime'
},
'summary' => {
'common-model' => 'summary'
},
'threshold' => {
'common-model' => 'threshold'
},
Add the
graphtype
property under thenodegraph
section within thesystem
property. In this case, include'sysuptime'
in thenodegraph
.Since the
graphtype
value is set to'sysuptime'
inCommon-sysuptime.nmis
, ensure it is properly referenced.
'system' => {
'nodeType' => 'server',
'nodeModel' => 'net-snmp',
'nodegraph' => 'health,combinedCPUload,response,ss-cpu,Host_Memory,ss-blocks,hrsystem,ip,tcp-conn,tcp-segs,laload,hrsmpcpu,hrmem,hrcachemem,hrbufmem,hrswapmem,hrvmem,sysuptime',
}
To generate the graph, we need to create the Graph-sysuptime.nmis
file in the models-custom
folder.
%hash = (
'heading' => 'Uptime',
'title' => {
'standard' => '$node - $length from $datestamp_start to $datestamp_end',
'short' => '$node - $length'
},
'vlabel' => {
'standard' => 'days',
'short' => 'd'
},
'option' => {
'standard' => [
'DEF:sysUpTimeCustom=$database:sysUpTimeCustom:AVERAGE',
'CDEF:sysUpTimeCustomDays=sysUpTimeCustom,8640000,/',
'LINE1:sysUpTimeCustomDays#0000ff: days'
],
'small' => [
'DEF:sysUpTimeCustom=$database:sysUpTimeCustom:AVERAGE',
'CDEF:sysUpTimeCustomDays=sysUpTimeCustom,8640000,/',
'LINE1:sysUpTimeCustomDays#0000ff: days'
]
}
);
After applying the changes outlined above, execute the data collection for the node associated with the specific model, in our case the nodeModel
is net-snmp
.
Different MIBs and OIDs can be used for different models, allowing users to customize them as needed.