Class NUTClient

Constructors

Methods

  • Allow to authenticate user on the UPS

    Parameters

    • username: string

      {string}

    • password: string

      {string}

    Returns Promise<void>

  • get the description of a command

    Parameters

    • ups: string
    • command: string

    Returns Promise<string>

  • get number of clients logged (using LOGIN command)

    Parameters

    • ups: string

    Returns Promise<number>

  • allow to select an UPS, and get an UPS object

    Parameters

    • name: string

      {string} name of the ups to search

    Returns Promise<undefined | UPS>

  • get the description of a variable

    Parameters

    Returns Promise<string>

  • get the type of variable ... Defined by the NUT driver, default to NUMBER

    Parameters

    Returns Promise<{
        type:
            | "RW"
            | "ENUM"
            | "STRING"
            | "RANGE"
            | "NUMBER";
    } & Record<string, unknown>>

  • List the logged clients on the UPS

    Parameters

    • ups: string

    Returns Promise<string[]>

  • list the available commands on the UPS

    Parameters

    • ups: string

    Returns Promise<string[]>

  • Allow to list variables

    Parameters

    • ups: string

    Returns Promise<Record<string, string>>

  • Parameters

    • ups: string

      {string} the name of the UPS

    Returns Promise<string>

    You probably shouldn’t send this command unless you are upsmon, or a upsmon replacement.

  • will log out and disconnect

    Returns Promise<string>

  • get network protocol version

    Returns Promise<string>

  • allow to send custom command

    Parameters

    • cmd: string[]

      {string[]} the command to send

    • Optionaltimeout: number

      {number} timeout for this command

    Returns Promise<string>

  • allow to set a variable

    Parameters

    Returns Promise<string>

  • allow to upgrade the connection with TLS

    Parameters

    • Rest...args: [tlsOptions?: Omit<ConnectionOptions, "socket" | "host" | "port">]

    Returns Promise<void>

    to check the arguments allowed

  • get server version

    Returns Promise<string>