Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 2.52 KB

File metadata and controls

80 lines (59 loc) · 2.52 KB

PhpCliShell for PatchManager

This application PatchManager use PatchManager addon and permit to browse DCIM objects.
It is possible to show location, cabinet, equipment and cable. You can do some research.

REQUIREMENTS

PatchManager

  • Import profiles which are in src/phpCliShell/addon/dcim/patchmanager/ressources
    • formats: ressources/formats
    • Reports: ressources/reports
    • Searches: ressources/searches

‼️ Do not rename custom profiles
‼️ Version 2.0 add new profiles!

INSTALLATION

PHP

Ubuntu only, you can get last PHP version from this PPA:
https://launchpad.net/~ondrej/+archive/ubuntu/php

  • add-apt-repository ppa:ondrej/php
  • apt update

You have to install a PHP version >= 7.1:

  • apt install php7.3-cli php7.3-mbstring php7.3-readline pphp7.3-soap php7.3-curl

For MacOS users which use PHP 7.3, there is an issue with PCRE. You have to add this configuration in your php.ini:

pcre.jit=0

To locate your php.ini, use this command: php -i | grep "Configuration File" *

PHAR

Download last PHAR release and its public key from releases

Be careful to keep public key filename same as PHAR filename with ".phar" extension

Print console help: $ php phpCliShell.phar --help

The PHAR contains all PhpCliShell applications and addons

WIZARD

wizard

Create PatchManager application configuration with command:
$ php phpCliShell.phar configuration:addon:factory dcim

Create PatchManager application launcher with command:
$ php phpCliShell.phar launcher:application:factory dcim

EXECUTION

CREDENTIALS FILE

/!\ For security reason, you can use a read only account!
Change informations which are between []

  • vim credentialsFile
    • read -sr USER_PASSWORD_INPUT
    • export DCIM_[DCIM_SERVER_KEY]_LOGIN=[YourLoginHere]
    • export DCIM_[DCIM_SERVER_KEY]_PASSWORD=$USER_PASSWORD_INPUT
      Change [DCIM_SERVER_KEY] with the key of your PatchManager server in configuration file

SHELL

Launch PhpCliShell for PatchManager service

  • source credentialsFile
  • php patchmanager.[key].php

COMMAND

Get command result in order to handle with your OS shell.
/!\ The result is JSON so you can use JQ https://stedolan.github.io/jq/
Change informations which are between []

  • source credentialsFile
  • php patchmanager.[key].php "[myCommandHere]"