...
Purging may not have been set up at installation time. If the OMK database has grown large it's a good idea to purge it in 90 day increments until the desired retention period is realized.
Related Documents
Purging of old data in opEvents
Determine the Purge Older Than Value
In order to purge from the database in 90 day increments the date of the oldest record is required.
Code Block |
---|
[root@opmantek ~]# mongo -u opUserRW -p op42flow42 nmis --eval 'db.rawlogs.findOne()'
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/nmis
MongoDB server version: 3.4.9
{
"_id" : ObjectId("5543df5db5d690352f1eb2cb"),
"entry" : "2015-05-01T16:17:19\t10.73.225.166\tUDP: [10.73.225.166]:14445->[10.72.0.31]\tSNMPv2-MIB::sysUpTime.0=23:5:15:52.26\tSNMPv2-MIB::snmpTrapOID.0=SNMPv2-SMI::enterprises.8072.4.0.3\tSNMPv2-MIB::snmpTrapEnterprise.0=SNMPv2-SMI::enterprises.8072.4",
"time" : NumberLong(1430511439),
"eventid" : ObjectId("5543df5db5d690352f1eb2ca"),
"type" : "nmis_traplog"
}
|
Notice the 'time' property above; 1430511439. The date command may be used to reveal when this was.
Code Block |
---|
[root@opmantek ~]# date --date @1430511439
Fri May 1 20:17:19 UTC 2015 |
The purge command can be passed a value in minutes with the option 'events_purge_older_than'. Some quick math will render an appropriate figure.
...
language | text |
---|
...
Determine Retention Interval
Run the opEvents Purge Command
...