Download the PHP package sunfoxcz/apc-pdu without Composer

On this page you can find all versions of the php package sunfoxcz/apc-pdu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apc-pdu

APC PDU Library

PHP library for reading data from APC PDU AP8XXX series via SNMP (v1 and v3) or SSH with Network Port Sharing support.

Requirements

Installation

Usage

SNMPv1 Connection

SNMPv3 Connection

Client Implementations

The library provides multiple SNMP client implementations with automatic discovery:

Method Description Dependencies
snmpV1() / snmpV3() Auto-detects best available client Any of the below
snmpV1Binary() / snmpV3Binary() Uses the snmpget binary via shell net-snmp package
snmpV1FreeDsx() / snmpV3FreeDsx() Uses the FreeDSx SNMP library freedsx/snmp composer package
snmpV1Native() / snmpV3Native() Uses PHP's native SNMP functions ext-snmp
ssh() Uses SSH/CLI interface ext-ssh2

Automatic Client Discovery

The snmpV1() and snmpV3() methods automatically detect and use the best available SNMP client in priority order:

  1. Binary - Most efficient batch operations (net-snmp package)
  2. FreeDSx - Efficient batch operations, pure PHP (freedsx/snmp)
  3. Native - Fallback, slower batch operations (ext-snmp)

If no client is available, a NoSnmpClientAvailableException is thrown.

Performance Comparison

Benchmark results (SNMPv3, AP8653 PDU):

Operation Native Binary FreeDSx SSH
Single device metric 128 ms 69 ms 73 ms 905 ms
Device metrics (batch) 1.26 s 200 ms 215 ms N/A*
Single outlet metric 62 ms 65 ms 233 ms 904 ms
Outlet metrics (batch) 1.09 s 213 ms 229 ms N/A*
All 24 outlets 25.82 s 7.07 s 7.45 s N/A*
Full PDU status 54.74 s 16.64 s 13.72 s N/A*

*SSH uses an interactive shell which adds latency. It supports only a limited set of metrics (Power, Energy, ApparentPower, PowerFactor, Current, Name) and cannot retrieve full device/outlet status.

Recommendations:

Run bin/benchmark to compare performance on your system. Use --ssh flag to include SSH in the comparison.

Device-Level Metrics

Outlet-Level Metrics

Outlet Control (Write Operations)

Device Reset Operations

Complete Status

Network Port Sharing (NPS)

When multiple PDUs are daisy-chained (up to 4 PDUs supported), specify the PDU index as the second parameter:

Testing Connection

Available Metrics

Device Metrics (DeviceMetric)

Metric Unit Description
ModuleIndex - Module index
PduIndex - PDU index
Name string Device name
LoadStatus LoadStatus Load status (Normal, LowLoad, NearOverload, Overload)
Power W Current power consumption
PeakPower W Peak power since last reset
PeakPowerTimestamp datetime When peak power occurred
PeakPowerStartTime datetime When peak power tracking started (last reset)
Energy kWh Total energy since last reset
EnergyStartTime datetime When energy tracking started (last reset)
ApparentPower VA Apparent power
PowerFactor ratio Power factor (0.0-1.0)
OutletCount - Number of outlets
PhaseCount - Number of phases
LowLoadThreshold % Low load warning threshold
NearOverloadThreshold % Near overload warning threshold
OverloadRestriction - Overload restriction setting

Outlet Metrics (OutletMetric)

Metric Unit Description
ModuleIndex - Module index
PduIndex - PDU index
Name string Outlet name/label
Index int Outlet index
State PowerState Power state (Off, On)
Current A Current draw
Power W Power consumption
PeakPower W Peak power
PeakPowerTimestamp datetime When peak power occurred
PeakPowerStartTime datetime When peak power tracking started (last reset)
Energy kWh Total energy
EnergyStartTime datetime When energy tracking started (last reset)*
OutletType string Outlet type (e.g., "IEC C13")
ExternalLink string External link URL

*Note: EnergyStartTime for outlets is shared across all outlets on a PDU (comes from device-level rPDU2DeviceStatusOutletsEnergyStartTime OID). When you reset an outlet's energy, all outlets share the same start time.

Enums

Tested Devices

Development

Running Tests with Docker

Without Docker

License

MIT License. See LICENSE for details.


All versions of apc-pdu with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sunfoxcz/apc-pdu contains the following files

Loading the files please wait ...