Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Interface Description Parsing not work #412

Open
3 tasks done
CopyBook-Maxim opened this issue Dec 27, 2023 · 7 comments
Open
3 tasks done

Custom Interface Description Parsing not work #412

CopyBook-Maxim opened this issue Dec 27, 2023 · 7 comments

Comments

@CopyBook-Maxim
Copy link

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Custom Interface Description Parsing not work.
If you specify the path to the custom parser in the settings, it will not be used.
At the same time the parser itself works, it was checked in the interpreter.
Also, if you add port_descr_type and port_descr_descr directly to the database, the charts are displayed

Expected behaviour

Must be used Custom Interface Description Parser

Actual behaviour

Custom Interface Description Parsing not used

Steps to reproduce

1 Create a custom parser
2 Specify it in the settings
3 Graphics with description from the example (Transit: Example Provider (AS65000)) get into ports

Docker info

@librenms:/var/librenms$ sudo docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 7
  Running: 7
  Paused: 0
  Stopped: 0
 Images: 5
 Server Version: 23.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc version: v1.1.5-0-gf19387a
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-73-generic
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.763GiB
 Name: librenms
 ID: 2436490e-5b8b-40d9-a3ed-437e9f7ee3ae
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

No response

Logs

-

Additional info

No response

@CopyBook-Maxim
Copy link
Author

Any update?

@murrant
Copy link
Member

murrant commented Feb 9, 2024

Custom Interface Description parsing is easy to break. You didn't say:

  1. what you are trying to do (including any configurations set and any custom parsing files)
  2. your expected outcome
  3. the actual outcome

@CopyBook-Maxim
Copy link
Author

Custom Interface Description parsing is easy to break. You didn't say:

  1. what you are trying to do (including any configurations set and any custom parsing files)
  2. your expected outcome
  3. the actual outcome

I am trying to do parsing of the UI description.
I created the file /opt/librenms/includes/custom/my-port-descr-parser.inc.php

librenms:/opt/librenms/includes/custom# ls -la
total 12
drwxr-xr-x 2 nobody nogroup 4096 Dec 28 10:35 .
drwxr-xr-x 1 nobody nogroup 4096 Dec 28 10:08 ..
-rw-r--r-- 1 nobody nogroup  653 Dec 28 10:35 my-port-descr-parser.inc.php

File Configuration:

<?php

// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset($port_ifAlias);

echo $this_port['ifAlias'];

$split = preg_split('/#/', $this_port['ifAlias']);
$type = trim($split[1]);
$descr = trim($split[0]);

$circuit = null;
$notes = null;
$speed = null;

if ($type && $descr) {
    $type = strtolower($type);
    $port_ifAlias['type'] = $type;
    $port_ifAlias['descr'] = $descr;
    $port_ifAlias['circuit'] = $circuit;
    $port_ifAlias['speed'] = $speed;
    $port_ifAlias['notes'] = $notes;

    d_echo($port_ifAlias);
}

unset($port_type, $port_descr, $port_circuit, $port_notes, $port_speed, $split);
vi config.php

# custom int_descr_parsing
$config['port_descr_parser'] = "includes/custom/my-port-descr-parser.inc.php";

image

Expected Outcome:
There will be graphs in the Ports -> Transit menu.

Current result: No graphs.

@brk1234
Copy link

brk1234 commented Feb 16, 2024

Hello,
I am having this same issue with my custom interface parsing script. It doesn't seem to be working!

@CopyBook-Maxim
Copy link
Author

Up

1 similar comment
@CopyBook-Maxim
Copy link
Author

Up

@CopyBook-Maxim
Copy link
Author

Any update pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants