New OS addition changes getting overwritten

I am adding a new OS type and added this files

  • ./html/images/os/cros.svg
  • ./html/images/logos/cros.svg
  • ./includes/definitions/discovery/cdot_cros.yaml
  • ./includes/definitions/cdot_cros.yaml

Running ./discovery.php -d -h <ip> manually or from browser debug works (i.e. I can see new logo and serial number etc).

However they get overwritten after sometime automatically with event logs of the form

2022-03-07 19:58:07		Serial: TBRV01-177C:006 ->
2022-03-07 19:58:07		Hardware: CRDT-100-S01 ->
2022-03-07 19:58:07		OS Version: CROS-S-1.0.2 #266 (base:6021) (Mon Mar 7 06:59:48 IST 2022) ->
2022-03-07 19:58:07		Device type: network -> server
2022-03-07 19:58:07		Device OS: cdot_cros -> generic
2022-03-07 19:58:07		Device OS changed: cdot_cros -> generic

Somehow I think I am missing addition in some other files to make my changes persistent. Any help is appreciated.

Validate.php output

bash-5.1# su librenms
/opt/librenms $ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 22.2.1
DB Schema | 2021_25_01_0129_isis_adjacencies_nullable (234)
PHP       | 7.4.28
Python    | 3.9.7
MySQL     | 10.4.14-MariaDB-1:10.4.14+maria~focal
RRDTool   | 1.7.2
SNMP      | 5.9.1
====================================

[OK]    Installed from the official Docker image; no Composer required
[OK]    Database connection successful
[FAIL]  Database: incorrect column (notifications/datetime)
[FAIL]  Database: incorrect column (users/created_at)
[FAIL]  We have detected that your database schema may be wrong
	[FIX]:
	Run the following SQL statements to fix it
	SQL Statements:
	 SET TIME_ZONE='+00:00';
	 ALTER TABLE `notifications` CHANGE `datetime` `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00' ;
	 ALTER TABLE `users` CHANGE `created_at` `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01' ;
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN]  Updates are managed through the official Docker image

Discovery.php o/p: Untitled - LibreNMS

Poller o/p: Untitled - LibreNMS

The only way I could think this would happen is if your device stopped responding correctly to some snmp queries.

Can you share your YAML files?

  • OS yaml file
/opt/librenms $ cat ./includes/definitions/cros.yaml
os: cros
text: 'C-DOT'
type: network
icon: cros
group: cros
over:
    - { graph: device_bits, text: 'Device Traffic' }
    - { graph: device_processor, text: 'CPU Usage' }
discovery:
    -
        sysObjectID: .1.3.6.1.4.1.5380.1.14
poller_modules:
    wireless: false
    ipmi: false
    applications: false
    services: false
    ntp: false
discovery_modules:
    services: false
    ntp: false
    wireless: false

mib_dir: cdot_cros

Discovery yaml file (Involving a proprietary MIB)

/opt/librenms $ cat ./includes/definitions/discovery/cros.yaml
modules:
    os:
        serial: CRX-CHASSIS-MIB::crxContentsSerialNum.2.1.1
        hardware: CRX-CHASSIS-MIB::crxContentsModelName.2.1.1
        version: CRX-CHASSIS-MIB::crxContentsSoftwareRev.2.1.1

Few more observations:

  • If I run ./discovery.php -h <> -m os in loop over a number of devices (around 15), I see that the nodes added earlier (say first or second node etc) lose their data by the time 13th, 14th node (for e.g.) gets added.

  • In case device was causing sporadic failures in SNMP reply, then wouldn’t it recover is automatically later (when device is not loaded). It only recovers on manual discovery.

Anyway if we want to check if there is some sporadic failures happening can it be checked at any log?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.