0.0.29 • Published 5 months ago

@zhoro/ndce v0.0.29

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

About the project

This is a simple project to execute different commands on a remote network devices using telnet protocol. Stores the results in a database.

Supported devices

Supported devices:

  • BDCOM OLT: GP3600-08B, P3310C, P3310D, P3600-08E, P3600-16E, P3608, P3608-2TE, P3608B-08E, P3616-2TE

Supported BDCOM commands:

  • enable
  • show cpu
  • show version
  • show epon|gpon active onu
  • show epon|gpon inactive onu
  • show epon|gpon interface epon x/y:z onu ctc opt
  • show epon|gpon onu information interface epon x/y
  • show epon|gpon optical-transceiver-diagnostic interface epon x/y
  • show mac-address-table dynamic
  • show mac-address-table int x y/z:w
  • show int status x/y:z
  • clear mib (clear counters)
  • clear mac-address-table dynamic

New commands can be easily added by extending the src/code/devices modules.

Getting started

Create .env file with the following content:

DEBUG_MODE=ndce:main,ndce:network-device,ndce:telnet-transport,ndce:exShEponOnuInfoInterface
CLIENT_USERNAME=admin-x
CLIENT_PASSWORD=password-y

Where CLIENT_USERNAME and CLIENT_PASSWORD are the default credentials for the network device. Also set the following DB environment variables (example for postgresql):

DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"

Apply migrations:

npx prisma migrate deploy --schema=./node_modules/@zhoro/ndce/prisma/schema.prisma

In your code import the PrismaClient class and create an instance of it:

import {PrismaClient} from '@zhoro/ndce';
const prisma = new PrismaClient();

For more information about Prisma setup environment see here.

Usage

  • initDatabaseSample.ts - example how to initialize or fill the database with sample data
  • start.ts - sample commands execution
  • exCron.ts - sample cron job execution
  • ex* - examples for different commands

Contact

email: 'andy@urlog.net'

project link: 'https://github.com/zhoro/ndce'

License

Distributed under the MIT License. See license.txt for more information.

0.0.28

5 months ago

0.0.29

5 months ago

0.0.25

6 months ago

0.0.26

6 months ago

0.0.27

5 months ago

0.0.24

6 months ago

0.0.23

7 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

12 months ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.16

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago