ko_center System User Documentation

Version: v0.70 (2026-08-01)
Type: PHP/Perl Web Application
Database: SQLite (ko_center.db3)
Location: /os/ai/io/ko_center.php

Table of Contents

1. Overview

ko_center is a single-file web application that provides a centralized dashboard for managing and monitoring system resources. It uses SQLite as its backend database and generates HTML pages dynamically via PHP.

The system provides:

2. Access & Login

Login

Access the system by navigating to the ko_center URL. If not logged in, the system presents a login form.

URL: http://<host>/ko_center/ko_center.php

Login credentials are validated against the hosts.allow file located at /os/ai/io/../safer/hosts.allow.

Once logged in, the user's role determines which features and data they can access.

Logout

Click the logout button (white icon) in the navigation bar to end your session.

Note: The system uses PHP sessions ($_SESSION) to track logged-in users. The session stores the user's role, which controls access to different features.

Button Squares

The main navigation bar provides quick access to all major features via button squares. Available buttons depend on user role:

ButtonURLDescription
Leds?q=ledsLED indicator display
Grid?q=db/gridDatabase grid views
KB?q=kbKnowledge Base
Reports?q=reportsReports & exports
Certs?q=certsCertificate management
Nodes?q=nodesNode/Host management
HW?q=hwHardware inventory
Plans?q=plansPlan management
Config?q=configSystem configuration
Login?q=loginLogin form
Logout?q=logoutEnd session
Tools?q=toolsSystem tools

4. URL Routing & Query Parameters

The system uses the q query parameter for routing. The parameter value is split by / to determine the page and sub-actions.

URL Format

ko_center.php?q=<page>/<action>/<id>

Routing Examples

URLPageAction
?q=ledsLED DisplayShow all current LEDs
?q=leds/detail/cab1LED DetailShow detail for cab1
?q=kbKnowledge BaseList KB entries
?q=kb/newKBCreate new KB entry
?q=kb/view/123KBView KB entry #123
?q=reports/rptReportsRun a report
?q=reports/sqlReportsSQL query interface
?q=db/grid/ko_center/ledsGridGrid view of leds table
?q=hwHardwareHardware inventory
?q=hw/cab1HardwareHardware for cab1
?q=triggerTriggerBroadcast refresh signal
?q=loginLoginLogin form
?q=logoutLogoutEnd session
?q=configConfigSystem configuration
?q=zoom/code/type/rowidZoomZoom viewer with hotspot
?q=zview/file/xmlZViewFull-screen zoom view
?q=ptviewerPTViewerPanorama viewer
?q=ptobjectPTObjectPanorama object
?q=aboutAboutAbout page
?q=konetKonetContact information
?q=form_request_accessAccessRequest access form

5. LED Display System

The LED display system is the core visual component of ko_center. Each LED record represents a monitored item with configurable visual properties.

LED Record Fields

FieldDescription
led_idUnique identifier (auto-increment)
led_statusCurrent status (active/inactive)
led_codeShort code identifier
led_nameDisplay name of the LED
led_dttmTimestamp marker ("current" for active records)
led_colorIndicator color (red, yellow, blue, green, pink, orange, black, white, trans)
led_speedBlink speed (0-3: no blink, slow, medium, fast)
led_typeLED type: manual, date, cmd, null
led_dateDate value (used with date-type LEDs)
led_cmdShell command to execute (used with cmd-type LEDs)
led_cmdoutCommand output
led_descDescription text
led_miscMiscellaneous data
led_cityLocation: city
led_bldgLocation: building
led_loc_codeLocation code
led_floorLocation: floor
led_groupGroup assignment
led_orgsOrganization assignment
led_titleTitle/label
led_publishedPublished flag (1/0)
led_widthDisplay width
led_heightDisplay height
led_commentUser comment
led_filenameAssociated file name
led_userUser who created/modified
led_user_ipIP address of user
led_refererHTTP referer
led_remote_portRemote port number
led_viewroleRole required to view
led_user_agentBrowser user agent string
led_unique_idUnique identifier string
led_errError flag
led_fixFix status
led_osOperating system

LED Types

TypeBehavior
manualStatic indicator with configurable color and blink speed
dateCalculates days from a target date; color and speed change based on proximity
cmdExecutes a shell command; shows green if command succeeds, red if it fails
nullShows a null/blank indicator

LED Blinking

LEDs use animated GIF files for blinking effects. The GIF filename is constructed from the color and speed:

ani_colorspeed.gif

Example: ani_red1.gif (red, slow blink)

LED Detail View

Clicking an LED name navigates to the detail view (?q=detail/<name>), which shows associated hardware items, images, and metadata.

6. Database Grid Views

The grid system provides sortable, filterable table views of any database table. It supports pagination, column sorting, and inline editing.

Accessing Grid Views

ko_center.php?q=db/grid/<dbcode>/<table>

Or use the shortcut:

ko_center.php?q=grid?dbcode=<dbcode>&table=<table>

Grid Features

Supported Database Tables

The system supports multiple database files with role-based access:

7. Reports

The reports system provides three types of report views:

SQL Report

Run custom SQL queries against the database and view results in a table.

ko_center.php?q=reports/sql

CSV Report

Export query results as CSV files for spreadsheet processing.

ko_center.php?q=reports/rpt/<rptcode>&fmt=header_csv

XML Report

Export query results as XML for programmatic consumption.

ko_center.php?q=kb/rpts/rpt_id&fmt=xml

Report Types

ReportURLDescription
LED Reports?q=leds/rptsLED status and configuration reports
KB Reports?q=kb/rptsKnowledge Base article reports
Datacenter Reports?q=dc/rptsDatacenter infrastructure reports
Certificate Reports?q=certs/rptsCertificate status reports
Console Reports?q=cons/rptsConsole/log reports
Host Reports?q=hosts/rptsHost inventory reports
ko_centerd Reports?q=ko_centerd/rptsko_center daemon reports
Node Reports?q=nodes/rptsNode/network reports

8. Knowledge Base

The Knowledge Base (KB) system allows users to create, view, and manage articles. KB entries are stored in the koaac_kb table in the ko_center.db3 database.

KB Table Schema

FieldTypeDescription
kb_idINTEGER PKAuto-increment primary key
kb_titleVARCHARArticle title
kb_bodyTEXTArticle content
kb_dttmVARCHARTimestamp
kb_userVARCHARAuthor username
kb_typeVARCHARArticle type/category

KB Actions

9. Certificates

The certificate management system allows viewing and managing digital certificates stored in the ko_center_certs.db3 database.

Certificate Actions

10. Nodes / Hosts

The node management system tracks network nodes and hosts. Nodes are displayed with their status, location, and associated metadata.

Node Actions

11. Hardware Inventory

The hardware inventory system tracks physical equipment with details such as model, serial number, IP address, HRC tag, and associated cabinet/location.

Hardware Actions

12. Plans

The plans system tracks project plans with steps, items, and status tracking.

Plan Actions

13. Tools

The tools section provides access to various system utilities:

Scrub

Data cleanup and maintenance tool.

ko_center.php?q=scrub

Upload

File upload utility for KB attachments and other files.

ko_center.php?q=upload

Zoom Viewer

Interactive zoomable image viewer with hotspot navigation.

ko_center.php?q=zoom/<code>/<type>/<rowid>

ZView

Full-screen zoom view with XML-based hotspot configuration.

ko_center.php?q=zview/<file>/<xml>

PTViewer

Panorama/tour viewer for 360-degree images.

ko_center.php?q=ptviewer

PTObject

Individual panorama object viewer.

ko_center.php?q=ptobject

14. Trigger / Auto-Refresh

The trigger system allows one browser to signal all other browsers to refresh their views. This is useful when one user makes a change that should be immediately visible to all other users.

How It Works

  1. Browser A is viewing the ko_center dashboard
  2. Browser B (or any client) calls ko_center.php?q=trigger
  3. The trigger endpoint writes a timestamp to ko_trigger.dat
  4. Browser A's JavaScript polling detects the new timestamp
  5. Browser A automatically reloads the page

Trigger Endpoint

ko_center.php?q=trigger

The endpoint accepts an optional last_check parameter:

ko_center.php?q=trigger&last_check=2026-08-01 07:00:00

Response Format

{
  "triggered": true,
  "timestamp": "2026-08-01 07:05:00",
  "since": "2026-08-01 07:00:00"
}

Client-Side Polling

The client page includes JavaScript that polls the trigger endpoint every few seconds. When a new trigger is detected, the browser automatically reloads.

15. Database Schema

Main Database: ko_center.db3

Location: /os/ai/io/ko_center.db3 (39.6 MB)

Key Tables

TableDescriptionRow Count
ledsLED indicator records262
randomusRandom user data101
leds_randomusCombined LED + randomus data101
ko_plansProject plans
ko_hwHardware inventory
koaac_kbKnowledge Base articles
nodesNetwork nodes
rolesUser roles
usersUser accounts
cabsCabinet/rack data
hrc_datacenters_equipmentDatacenter equipment
defrag_planDefragmentation plans
periodsTime periods
rptsReport definitions
cfgConfiguration settings
dbsDatabase registry
menusMenu definitions
fpFloor plan data
gridGrid configuration
usUser-specific data
n11N11 monitoring data
panoPanorama data
objObject data
zoomZoom configuration
zoomxmlZoom XML data
shelvesShelf data
halloHallo data
haloHalo data
nimbusNimbus data
aureoleAureole data
leds_defaultsLED default settings
leds_racksLED rack mappings
leds_randomusCombined LED + randomus101

leds_randomus Table

The leds_randomus table combines the schema of the leds table (all columns, with LED fields blank/NULL) with all columns from the randomus table. It contains only records from the randomus table (101 rows).

Creation script: /os/ai/io/new_leds.py

16. Key Files

FileDescription
/os/ai/io/ko_center.phpMain application (PHP, 16,322 lines, 205 functions)
/os/ai/io/ko_center.db3SQLite database (39.6 MB)
/os/ai/io/ko_center.pyPython Flask equivalent of ko_center.php
/os/ai/io/new_leds.pyScript to create leds_randomus from leds + randomus
/os/ai/io/new_leds_tbl.pyGeneralized script to create leds_<tbl2> from leds + any table
/os/ai/io/cr_leds.pyScript to create blinking LED GIF images
/os/ai/io/response_trigger_plan.txtTrigger mechanism design document
/os/ai/io/prompt_php_trigger.txtOriginal prompt for trigger feature
/os/ai/io/prompt_cr_icons.txtOriginal prompt for LED GIF creation
/os/ai/io/prompt_sql3_leds_randomus.txtOriginal prompt for leds_randomus table
/os/ai/io/ko_center.htmlThis user documentation file
/os/ai/io/ko_trigger.datTrigger timestamp file (created at runtime)
/os/ai/io/../safer/hosts.allowAuthentication/authorization file
/os/ai/io/ko_center/kb/Knowledge Base file storage directory
/os/ai/io/ko_center/db3/Database files directory
/os/ai/io/images/btn/Button image assets
/os/ai/io/images/ani/Animated LED GIF images
/os/ai/io/images/fpb/Floor plan button images

Appendix A: Python ko_center.py

A Python Flask equivalent of ko_center.php has been created at /os/ai/io/ko_center.py. It provides the same core functionality:

Running the Python version:

python3 /os/ai/io/ko_center.py

Then browse to http://localhost:5000

Appendix B: LED GIF Creation

The cr_leds.py script generates blinking LED GIF images using ImageMagick. For each color (red, yellow, blue, green, pink, orange, black, white, transparent) and each speed (0=no blink, 1=slow, 2=medium, 3=fast), it creates an animated GIF file.

Usage:

python3 cr_leds.py <static_image.png> <dynamic_image.png>

Output files:

led_<prefix>_red_0.gif   (no blink)
led_<prefix>_red_1.gif   (slow blink)
led_<prefix>_red_2.gif   (medium blink)
led_<prefix>_red_3.gif   (fast blink)
led_<prefix>_yellow_0.gif
...
led_<prefix>_trans_3.gif

There are 9 colors × 4 speeds = 36 GIF files per static image.

admin.html
sysadm.html