lumnik. / scenarios All scenarios · Français

An application inventory with hand-typed URLs

Goal Split each URL into server, port and environment, to know what runs on a server and what is still in staging.

IT takes over an application inventory kept for years in a spreadsheet.

The URL column is typed by hand:

The manifest splits the URL into columns, without code.

applications.csv
app_code;owner;url;status
ERP;Finance;https://SRV-ERP-PRD01.corp.local:8443/erp/login;actif
PORTAIL;Ventes;https://srv-erp-prd01.corp.local:8443/portail;actif
CRM;Ventes;http://srv-crm-rec02.corp.local/crm;actif
GMAO;Maintenance; https://srv-gmao-prd01.corp.local:9443 ;actif
PAIE;RH;https://srv-paie-prd01.corp.local/paie;actif
BI;Direction;https://srv-bi-dev01.corp.local:3000/dash;actif
QUALITE;Production;https://Srv-Qual-Rec01.corp.local/qualite;actif
INTRANET;Communication;https://intranet.corp.local;actif
EDI;Logistique;ftp://srv-edi-prd01.corp.local:21;actif
WIKI;DSI;https://wiki.corp.local;retiré
ANCIEN-CRM;Ventes;http://srv-crm-prd01.corp.local/crm;retiré
TICKETS;DSI;https://srv-tickets-prd02.corp.local/;actif
$ lm entity get application_c --limit 100
APP_CODE  OWNER          URL                                              SCHEME  SERVER                        PORT  ENVIRONMENT      _CONFLICTS
BI        Direction      https://srv-bi-dev01.corp.local:3000/dash        https   srv-bi-dev01.corp.local       3000  développement    {}
CRM       Ventes         http://srv-crm-rec02.corp.local/crm              http    srv-crm-rec02.corp.local            recette          {}
EDI       Logistique     ftp://srv-edi-prd01.corp.local:21                                                            hors-convention  {}
ERP       Finance        https://srv-erp-prd01.corp.local:8443/erp/login  https   srv-erp-prd01.corp.local      8443  production       {}
GMAO      Maintenance    https://srv-gmao-prd01.corp.local:9443           https   srv-gmao-prd01.corp.local     9443  production       {}
INTRANET  Communication  https://intranet.corp.local                      https   intranet.corp.local                 hors-convention  {}
PAIE      RH             https://srv-paie-prd01.corp.local/paie           https   srv-paie-prd01.corp.local           production       {}
PORTAIL   Ventes         https://srv-erp-prd01.corp.local:8443/portail    https   srv-erp-prd01.corp.local      8443  production       {}
QUALITE   Production     https://srv-qual-rec01.corp.local/qualite        https   srv-qual-rec01.corp.local           recette          {}
TICKETS   DSI            https://srv-tickets-prd02.corp.local/            https   srv-tickets-prd02.corp.local        production       {}
$ lm entity get application_c --filter server=srv-erp-prd01.corp.local
APP_CODE  OWNER    URL                                              SCHEME  SERVER                    PORT  ENVIRONMENT  _CONFLICTS
ERP       Finance  https://srv-erp-prd01.corp.local:8443/erp/login  https   srv-erp-prd01.corp.local  8443  production   {}
PORTAIL   Ventes   https://srv-erp-prd01.corp.local:8443/portail    https   srv-erp-prd01.corp.local  8443  production   {}

$ lm entity get application_c --filter environment=recette
APP_CODE  OWNER       URL                                        SCHEME  SERVER                     PORT  ENVIRONMENT  _CONFLICTS
CRM       Ventes      http://srv-crm-rec02.corp.local/crm        http    srv-crm-rec02.corp.local         recette      {}
QUALITE   Production  https://srv-qual-rec01.corp.local/qualite  https   srv-qual-rec01.corp.local        recette      {}

$ lm entity get application_c --filter environment=hors-convention
APP_CODE  OWNER          URL                                SCHEME  SERVER               PORT  ENVIRONMENT      _CONFLICTS
EDI       Logistique     ftp://srv-edi-prd01.corp.local:21                                     hors-convention  {}
INTRANET  Communication  https://intranet.corp.local        https   intranet.corp.local        hors-convention  {}

Limits

  • regex-extract does not count a miss: a pattern that does not read a line leaves its columns empty without warning, and a default downstream may fill them.
  • default fills a constant: a protocol's port is not inferred.
  • Synthetic inventory.

IT · inventory

What runs on this server?

The inventory exists, in a spreadsheet.

One URL per application, typed by hand for years.

Synthetic inventory

The problem

A URL is not a column.

  • SRV-ERP-PRD01 and srv-erp-prd01.
  • Stray spaces.
  • A port sometimes there, sometimes not.

Nothing is changed

The spreadsheet stays as is.

  • lumnik reads each URL.
  • It splits it: server, port, environment.
  • Retired applications are dropped and counted.

What it took to write

- lookup:
    column: environment
    table: { prd: production,
             rec: recette }

The server name tells the environment.

The whole scenario fits in 2 declaration files, 60 lines.

The answers

IT's questions, one filter each.

  • srv-erp-prd01: ERP and PORTAIL.
  • In staging: CRM and QUALITE.
  • Off the convention: INTRANET and EDI.

The limit

A pattern that misses a line does not say so.

  • EDI, in ftp://, has no server.
  • A protocol's port is not guessed.

Try it

The scenario replays end to end.

One connector, one entity: each step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →