Giter Club home page Giter Club logo

i-doit-cli's People

Contributors

bheisig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tabulon-ext

i-doit-cli's Issues

Merge duplicated vendors

Command: merge-vendors
Affected category: model
Affected attributes: manufacturer and model

Interactive mode

$ idoitcli merge-vendors
List of available vendors:
    1: HP
    2: Hewlett-Packard
    3: HP, Inc.
Which vendors do you like to merge? 1, 2, 3
Which name do you prefer? (Select numer or enter new name): Hewlett-Packard Company
Merging…
    Create new vendor "Hewlett-Packard Company"
    Merge models from vendor "HP" [1] to "Hewlett-Packard Company" [4]
    Merge models from vendor "Hewlett-Packard" [2] to "Hewlett-Packard Company" [4]
    Merge models from vendor "HP, Inc." [3] to "Hewlett-Packard Company" [4]
    Purge out-dated models
    Purge out-dated vendors
Done

Non-interactive mode

  • ---merge-vendor=VENDOR: Select vendor to be merged; repeat this option for more vendors
  • --prefered-vendor=VENDOR: Prefered vendor

VENDOR represents the name or its identifier. A new one will be created if the name does not exist.

$ idoitcli merge-vendors \
    --merge-vendors="HP" \
    --merge-vendors="Hewlett-Packard" \
    --merge-vendors="HP, Inc." \
    --prefered-vendor="Hewlett-Packard Company"
Merging…
    Create new vendor "Hewlett-Packard Company"
    Merge models from vendor "HP" [1] to "Hewlett-Packard Company" [4]
    Merge models from vendor "Hewlett-Packard" [2] to "Hewlett-Packard Company" [4]
    Merge models from vendor "HP, Inc." [3] to "Hewlett-Packard Company" [4]
    Purge out-dated models
    Purge out-dated vendors
Done

Unable to get userId by credentials

Command issued: idoitcli cache

Expected behavior

idoitcli starting to build the cache

Actual behavior

idoitcli cache
Create cache files needed for faster processing
Clear cache files
Fetch list of object types
No proper configuration for i-doit API calls: i-doit responded with an error: i-doit system error: Unable to get userId by credentials

Steps to reproduce the behavior

  • download any version of idoitcli
  • use a passwort that contains special characters like '(' and ')'

I guess that this is the relevant part, because nothing else has been changed on my side.

Our DEV system behaves the same. And everything worked fine with a password that didn't use '(' and ')'. Interactive logon with this password also woks fine, so I expect idoitcli to be tha password muncher.

Environment

Question Answer
bheisig/idoitapi version 0.9, fresh from the site
i-doit version 1.13.2 PRO
i-doit API add-on version im Source steht Version 1.10

Logs and other useful output

  • see above
  • in ssl-error.log I find "AH01382: Request header read timeout" from my host address.
  • in ssl-access.log there are only HTTP 200 return codes around that time
  • inside i-doit, nothing in the logbook around that time
  • nothing else found

Visualize hardware racks

  • Visualize racks as ascii art
  • Show statistics: How many rack units are available/occupied?
  • Show complete rack with empty rack units or show only rack units which are occupied
  • Command rack

Enhance BASH completion

Expected behavior

When using bash the completion script should auto-complete user keyboard interactions for every single command and its options. This includes:

  • All commands, for example read
  • All common options, for example --help or -c
  • All command-specific options and arguments, for example idoitcli read server

Actual behavior

Script only supports a subset of available commands, but not a single option/argument.

Steps to reproduce the behavior

idoitcli re<tab>
idoitcli read ser<tab>

Environment

Question Answer
idoitcli version 0.5

Authentication required - why?

Expected behavior

Our idoit installation allows to use the API without login, using the API key only.

Since I want to share the idoitcli invocation scripts, it should be sufficient to use the API key in the credentials file. But it is not, idoitcli complains (see below).

I'd like to see idoitcli working without logon. Sharing scrips nearly always includes config files laying around anywhere, and since they are not even encrypted, everyone can read each other's credentials. This is especially bad when using SSO...

Actual behavior

12:38 user@host:~/.idoitcli> idoitcli show vsrvr.intranet.my.corp
One or more errors found in configuration settings:
Configuration setting "api.username" is too short. Minimum length is 1 character(s).
Configuration setting "api.password" is too short. Minimum length is 1 character(s).
Cannot proceed unless you fix your configuration

If I use "x" and "y", respectively, I get

No proper configuration for i-doit API calls: i-doit responded with an error: Authentication error [error: Either your username or password is invalid.]

Since username and password are not required, this data should not not be transmitted and thus this error should now show.

Steps to reproduce the behavior

Empty the password and username entries. Or enter non-fitting data. And use idoitcli afterwards.

Environment

Question Answer
idoitcli version idoitcli 0.7
PHP version PHP 7.2.5
i-doit version i-doit 1.11.1 PRO
i-doit API add-on version 1.9

Server logs

Excerpt taken from /var/log/apache2/error.log:

no access to the system

Excerpt taken from /var/www/html/i-doit/log/api_*.log:

no access to this system. Might be /srv/www/... on SLES instead ;)

P.S.: according to https://kb.i-doit.com/pages/viewpage.action?pageId=7831613, a user login is not required, it can be configured off.

Update category entry

idoit update server/mylittleserver/location --he 11
idoit update server/mylittleserver/hostaddress/1 --ipv4address 192.168.42.23

List categories

idoit list categories

Options:

  • --enabled: List only enabled categories
  • --disabled: List only disabled categories
  • --global: List only "global" categories
  • --specific: List only "specific" categories
  • --custom: List only custom categories

List all object types

idoit list types

Options:

  • --enabled: List only enabled object types
  • --disabled: List only disabled object types

Print list of IP addresses

A "picture" says more than thousand words…

$ idoitcli iplist "*0815"
Print list of IP addresses

Cloud Storage VLAN 0815                                         [#42128]

    Contact:                                           [email protected]
    John Doe                                            +49 555 12345678

    Net address:     10.23.42.0/24         In use:            1/255
    VLAN ID:         42                    Next free address: 10.23.42.2
    Default gateway: 10.23.42.1

╔═════════════════╦════════════════════════════════════════════════════╗
║      10.23.42.1 ║ ☺ █ gateway001.example.com      [server] [#324712] ║
╠═════════════════╬════════════════════════════════════════════════════╣
║      10.23.42.2 ║ free █████████████████████████████████████████████ ║
╠═════════════════╬════════════════════════════════════════════════════╣
║    10.23.42.254 ║ free █████████████████████████████████████████████ ║
╚═════════════════╩════════════════════════════════════════════════════╝

Add support for custom categories

"Custom categories" are user-defined categories with custom attributes. These categories should be handled correctly by all commands, including:

  • cache
  • categories
  • read
  • save
  • show

unable to get local issuer certificate

Expected behavior

When I issue "idoitcli cache", I expect idoitcli to fill the local cache.

Actual behavior

> idoitcli cache
Create cache files needed for faster processing
Clear cache files
Fetch list of object types
No proper configuration for i-doit API calls: Connection to Web server failed [60]: SSL certificate problem: unable to get local issuer certificate

Where has this certificate to be located? Do I have to provide the info in the config file? Does only the last issuer matter or do I need to provide the whole chain?

Steps to reproduce the behavior

Enter the command "idoitcli cache".

Environment

Question Answer
bheisig/idoitapi version 0.9
i-doit version 1.14.1 Revision 202011401 pro
i-doit API add-on version 1.10

Logs and other useful output

The only log I get is shown above.

Add ZSH completion script

Expected behavior

Support auto-completion for ZSH (Z Shell)

See issue #9 for details

Actual behavior

There is no script available for ZSH's auto-completion.

Steps to reproduce the behavior

idoitcli <tab><tab>
idoitcli re<tab>

Environment

Question Answer
idoitcli version 0.5

Missing documentation: How to upload a file?

I chanced in issuing idoitcli create file/"Patches MYHOST_2011-05-03.txt"
The file entry showed up in idoit. But how do I upload the file via idoitcli?

Expected behavior

idoitcli list or idoitcli create -h should show some hints how to upload files to idoit. From using the API, I know that there would be 3 steps:

  • create the file object (that I did)
  • upload the file content (cmdb.category.create)
  • link the file to MYHOST (also cmdb.category.create)

Actual behavior

There are no hints available how to achieve this.

Steps to reproduce the behavior

Get a file and try to upload 😁

  • idoitcli create file/"Patches MYHOST_2011-05-03.txt" creates a File object named "Patches MYHOST_2011-05-03.txt" inside idoit
  • idoitcli create ??? uploads the file content
  • idoitcli create ??? joins the file to another object, like a Server object

I'm sorry if I missed available docs, but I've been too thick to find them. 😞

Regards, Werner

Not possible to set memory capacity

In version 0.7 it's not possible to set the capacity of memory of a virtual server:

idoitcli save virtual\ server/myserver.example.com/memory
Create/update CMDB objects and their category entries

[Memory] Title?
[Memory] Manufacturer?
[Memory] Type?
[Memory] Memory unit?
[Memory] Description?

Setting a Memory unit of "8 GB" is not possible also.

What am I missing?

List object type groups

idoit list groups

Options:

  • --enabled: List only enabled object type groups
  • --disabled: List only disabled object type groups

Export CMDB data

Export every single detail from i-doit

For example, create a Word document:

idoitcli export --format markdown | pandoc --from markdown --to docx --output cmdb.docx

Options

Option Description
--format markdown, json, raw (default)
--toc Add table of contents
--types Limit output to comma-separated list of object types (by their titles, constants or identifiers)
--ids Limit output to comma-separated list of objects (by their identifiers)

Output

  • List every object type (table)
  • For each object type: List every object (table)
  • For each object list every category entry (table)

Create new log book entry for an object

idoitcli log # interactive mode: ask for object, when open editor for message
idoitcli log 1000 # select object by its identifier; open editor for message
idoitcli log -m "Rebooted because of kernel updates" # interactive mode: ask for object
idoitcli log mylittleserver -m "Rebooted because of kernel updates" # select object by its title
  • Select object by its title or identifier
  • If object is not given try to identify object by current hostname
  • Add message by option -m or --message, otherwise open editor
  • Editor is chosen by environment variable EDITOR

Create/update CMDB objects and their category entries

Create a new object

idoitcli set server/mylittleserver

Create/update attributes in a single-value category

idoitcli set server/mylittleserver/model --manufacturer A --title 123
idoitcli set server/mylittleserver/location --he 11

Update attributes in a multi-value category

idoitcli set server/mylittleserver/hostaddress/1 --ipv4address 192.168.42.23

Interactive mode

First, collect data:

$ idoitcli set
Create new object
Type? server
Title? mylittleserver
Add more attributes [y/N]? y
[Model] Manufacturer? A
[Model] Model? 123
[Hostaddress] Hostname? mylittleserver
[Location] Location? rackXY
[…]
  • Add more attributes will be asked if template is available (see below)
  • Category/attribute names will be printed human-readable
  • Print summary before pushing data to i-doit

Templates

Based on object type specific templates in configuration file create/update objects and their attributes.

{
    "templates":
        "server": [
            {
                "category": "C__CATG__MODEL",
                "attribute": "manufacturer"
            },
            {
                "category": "C__CATG__MODEL",
                "attribute": "title"
            },
            {
                "category": "C__CATG__IP",
                "attribute": "hostname"
            },
            {
                "category": "C__CATG__LOCATION",
                "attribute": "location"
            }
        ]
}
  • Order matters

Common aspects

  • It's irrelevant if a new data set will be created or an existing one will be updated. Instead, print to STDOUT what happened exactly.

Read from i-doit logbook

idoitcli logbook # Read everything
idoitcli logbook 123 # Read everything about an object by its identifier
idoitcli logbook mylittleserver # Read everything about an object by its title
idoitcli logbook -n100 # Read last 100 entries
idoitcli logbook -f # Follow
idoitcli logbook --since today # Read everything since a specific date
  • Combination of any argument/option is valid

where are the certificates expected to be?

Expected behavior

I executed idoitcli init and idoitcli configtest, which told me everything is OK.

I want to execute idoitcli cache to build the local cache.

Actual behavior

Now I'm trying idoicli cache, and I get

Create cache files needed for faster processing
Clear cache files
Fetch list of object types
No proper configuration for i-doit API calls: Connection to Web server failed [60]: SSL certificate problem: unable to get local issuer certificate

So, since I set curl.cainfo and openssl.capath in my php.ini (all of them, for apache2, cli, and fastcgi), and this does not help any, where does idoitcli expect the certificates? BTW, the only certificates involved are from an offical CA (Telekom), intermediate CA and server CA (both DFN e.V.), so the settings on OS level should suffice.

Steps to reproduce the behavior

See above, please.

Environment

Question Answer
bheisig/idoitapi version 0.9
i-doit version 1.15.2 pro
i-doit API add-on version ? has been updated along by the software partner

Logs and other useful output

The output seems to be on client side only.

idoitcli init --> api.username" is too short.

Expected behavior

Some simple questions will be asked how to access your i-doit installation.

Actual behavior

One or more errors found in configuration settings:
Configuration setting "api.username" is too short. Minimum length is 1 character(s).
Configuration setting "api.password" is too short. Minimum length is 1 character(s).
Cannot proceed unless you fix your configuration

Steps to reproduce the behavior

idoitcli init

Environment

OS: Fedora 29

Question Answer
idoitcli version 0.5
PHP version 7.2.11
i-doit version 1.11.1 pro
i-doit API add-on version 1.9.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.