Friday, October 30, 2026

Docker, Autostart, and NFS Configurations

This week, after some PHP, SSL Certificate, and TCP stack advisories came out, my docker server rebooted automatically after patching.

Nothing came back online properly.

Sure, the services all tried to start in docker, but all of them failed.  It turned out after some investigation that the NFS never got mounted up.

So, rather than running docker in that state, I first found the systemctl file by running :

    systemctl list-units --type=mount

Then, I edited the /etc/systemd/system/multi-user.target.wants/docker.service and found the After= line, and added the mount.service file found.  Saved it out, and now docker should not even start without having the NFS configuration files and web documents involved.

Tuesday, October 20, 2026

Old NVR Firmware Upgrade

I have an old LaView LV-N9508Q8E network video recorder.  I wanted better monitoring, so I tried to enable SNMP.  The firmware does not support it, and LaView is gone the way of the world, but it looks like this is a re-badged HIKVision DS-7608NXI-K1/8P.  Maybe I can upgrade the firmware to a non-LaView firmware?

The background is that LaView is non-existant any longer.  However,  

So, downloading that firmware should, in theory, allow me to drop in the latest HIKVision firmware that might enable SNMP.  It might also enable better motion detection alerting (send it through an Apache web service?).

This was a fun trip.  I tried upgrading to a HIKVISION firmware first via the web browser, and also from the command line.  This lead me to setting up a new tftp server, dropping the 3.4.112 version of firmware into the tftp root directory as "digicap.dav", and building a 1.5mm, 4-pin JST header for the serial output. A "screen /dev/DEVICENAME 115200" gave me the console.

After reading up a lot on the "upgrades", the instructions looked fairly simple.  However, once I got in there (you have to hit the control-u often and quickly while you are turning the device on, FYI), you might get launched into an upgrade script automatically. 

I didn't.  Instead, I got an "HKVS $" prompt.

    
    U-Boot 2010.06-svn17334 (Sep 15 2017 - 19:37:08)
    
    Hit ctrl+u to stop autoboot:  0
    HKVS $

Instead, I had to run a series of commands that appear very "hacky".  As in SQL database drop-table hacky, like adding a semi colon and letting the parser run another command that you couldn't otherwise get to.  For example :

    setenv ';setenv ipaddr 192.168.128.8;saveenv'
    setenv ';setenv serverip 192.168.128.6;saveenv'

These will set IP addresses, then save the environment variables for the next session (yeah, you have to save between sessions).  Essentially, the output looked like :

    U-Boot 2010.06-svn17334 (Sep 15 2017 - 19:37:08)
    
    Hit ctrl+u to stop autoboot:  0 
    HKVS $ setenv ';setenv ipaddr 192.168.128.8;saveenv'
    Saving Environment to SPI Flash...
    Warning: Erase size 0x00001000 smaller than one erase block 0x00010000
             Erasing 0x00010000 instead
    Erasing SPI flash, offset 0x00120000 size 64K ...done
    Writing to SPI flash, offset 0x00120000 size 4K ...done
    HKVS $ setenv ';setenv serverip 192.168.128.6;saveenv'
    Saving Environment to SPI Flash...
    Warning: Erase size 0x00001000 smaller than one erase block 0x00010000
             Erasing 0x00010000 instead
    Erasing SPI flash, offset 0x00120000 size 64K ...done
    Writing to SPI flash, offset 0x00120000 size 4K ...done
    HKVS $

Now, I could start the upgrade :

    setenv ';upgrade'

And (after a few minutes), I was running native HikVISION firmware!  I then upgraded to 4.30.097, and did a full factory reset (gotta clean 'er up, eh?).

After it came back online, no cameras were coming online.  Turns out, I have to do a camera reset on every one of those (which might prove a little difficult since they are all PoE).


So, after a quick factory reset... nothing.  I am losing interest here, as it still doesn't work in the browser, and in Windows, it prompted for a "plug-in".  But, it did have an option to enable ssh, and if you do that, you can shell as "root" to the device using your "admin" password.  It is a very limited shell, but allows you to run "dmesg", which will tell you exactly what is on this set of hardware :

    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Linux version 3.18.20 (root@CI-Backend-Slave-65-115) (gcc version 4.9.4 20150629 (prerelease) (Hisilicon_v500_20170922) ) #2 SMP Wed Dec 14 17:22:34 CST 2022
    [    0.000000] setup for rdinit= is not allowed, disable it!
    [    0.000000] setup for load_ramdisk= is not allowed, disable it!
    [    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine model: HIKVISON K74 Platform Board
    [    0.000000] Uboot is not supported safe version:V0
    [    0.000000] Command [ipaddr] is not supported, please check cmdline.
    [    0.000000] Command [192.168.128.8] is not supported, please check cmdline.
    [    0.000000] Command [serverip] is not supported, please check cmdline.
    [    0.000000] Command [192.168.128.6] is not supported, please check cmdline.
    [    0.000000] Command [serverip] is not supported, please check cmdline.
    [    0.000000] Command [192.168.128.6] is not supported, please check cmdline.
    [    0.000000] Command [bootpart=] is not supported, please check cmdline.
    [    0.000000] HIKBASE version ##78762[kernel:74730] v2.1.0 build 2022-12-14
    [    0.000000] HIKBSP svnpath: baseline/branches/trunk-v2.3.2/hikbsp-v2@85692
    [    0.000000] request_module: runaway loop modprobe fs-proc
    [    0.000000] Ignoring unrecognised tag 0x54410001
    [    0.000000] Ignoring unrecognised tag 0x54410009
    [    0.000000] cpldinfo offset[0x100000], size[0x100].
    [    0.000000] Ignoring unrecognised tag 0x484b0002
    [    0.000000] Ignoring unrecognised tag 0x484b0004
    [    0.000000] Ignoring unrecognised tag 0x484b0005
    [    0.000000] CMEM[10]: 0x83000000+0x00020000 reserve ok!
    [    0.000000] Memory policy: Data cache writealloc
    [    0.000000] On node 0 totalpages: 163840
    [    0.000000] free_area_init_node: node 0, pgdat c07eb180, node_mem_map e7af7000
    [    0.000000]   Normal zone: 1280 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 163840 pages, LIFO batch:15
    [    0.000000] PERCPU: Embedded 9 pages/cpu @e7ad9000 s6080 r8192 d22592 u36864
    [    0.000000] pcpu-alloc: s6080 r8192 d22592 u36864 alloc=9*4096
    [    0.000000] pcpu-alloc: [0] 0 [0] 1 
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 162560
    [    0.000000] Kernel command line: mem=640M console=ttyS0,115200n8 noinitrd ip=ADDR:ADDR:MULTICAST:MASK:Hik-eth:eth0:none 
    [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Memory: 640796K/655360K available (4770K kernel code, 207K rwdata, 1468K rodata, 1632K init, 272K bss, 14564K reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    [    0.000000]     vmalloc : 0xe8800000 - 0xff000000   ( 360 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xe8000000   ( 640 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc061fc3c   (6240 kB)
    [    0.000000]       .init : 0xc0620000 - 0xc07b8000   (1632 kB)
    [    0.000000]       .data : 0xc07b8000 - 0xc07ebe60   ( 208 kB)
    [    0.000000]        .bss : 0xc07ebe60 - 0xc083009c   ( 273 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
    [    0.000000] Hierarchical RCU implementation.
    [    0.000000] 	Additional per-CPU info printed with stalls.
    [    0.000000] 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000011] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655765682ns
    [    0.000195] Console: colour dummy device 80x30
    [    0.000210] Calibrating delay loop... 2596.86 BogoMIPS (lpj=12984320)
    [    0.060049] pid_max: default: 32768 minimum: 301
    [    0.060145] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.060154] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.060644] CPU: Testing write buffer coherency: ok
    [    0.060875] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [    0.061004] Setting up static identity map for 0x8048d698 - 0x8048d6f0
    [    0.062109] CPU1: Booted secondary processor
    [    0.120070] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
    [    0.120134] Brought up 2 CPUs
    [    0.120147] SMP: Total of 2 processors activated (5187.17 BogoMIPS).
    [    0.120152] CPU: All CPU(s) started in SVC mode.
    [    0.121697] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
    [    0.121974] pinctrl core: initialized pinctrl subsystem
    [    0.122136] regulator-dummy: no parameters
    [    0.123688] NET: Registered protocol family 16
    [    0.123900] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.123915] Find the board(K74).
    [    0.123921] Current board is PCB[0x80315], BOARD[0x4600]
    [    0.126853] Serial: AMBA PL011 UART driver
    [    0.126939] 12080000.uart: ttyS0 at MMIO 0x12080000 (irq = 38, base_baud = 0) is a PL011 rev2
    [    0.127107] console [ttyS0] enabled
    [    0.127280] uart-pl011 12090000.uart: aliased and non-aliased serial devices found in device tree. Serial port enumeration may be unpredictable.
    [    0.127296] 12090000.uart: ttyS1 at MMIO 0x12090000 (irq = 39, base_baud = 0) is a PL011 rev2
    [    0.127428] uart-pl011 120a0000.uart: aliased and non-aliased serial devices found in device tree. Serial port enumeration may be unpredictable.
    [    0.127442] 120a0000.uart: ttyS2 at MMIO 0x120a0000 (irq = 40, base_baud = 0) is a PL011 rev2
    [    0.161021] SCSI subsystem initialized
    [    0.161150] libata version 3.00 loaded.
    [    0.161353] usbcore: registered new interface driver usbfs
    [    0.161404] usbcore: registered new interface driver hub
    [    0.161443] usbcore: registered new device driver usb
    [    0.162097] Switched to clocksource timer00
    [    0.165750] NET: Registered protocol family 2
    [    0.166268] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.166333] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.166421] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.166473] TCP: reno registered
    [    0.166484] UDP hash table entries: 512 (order: 2, 16384 bytes)
    [    0.166525] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
    [    0.166698] NET: Registered protocol family 1
    [    0.166947] RPC: Registered named UNIX socket transport module.
    [    0.166956] RPC: Registered udp transport module.
    [    0.166960] RPC: Registered tcp transport module.
    [    0.166965] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.715919] persistent_ram: uncorrectable error in header
    [    0.716011] persistent_ram: uncorrectable error in header
    [    0.716097] persistent_ram: uncorrectable error in header
    [    0.716357] console [pstore-1] enabled
    [    0.716448] pstore: Registered ramoops as persistent store backend
    [    0.716455] ramoops: attached 0x20000@0x83000000, ecc: 16/0
    [    0.716944] futex hash table entries: 512 (order: 3, 32768 bytes)
    [    0.723834] NFS: Registering the id_resolver key type
    [    0.723886] Key type id_resolver registered
    [    0.723891] Key type id_legacy registered
    [    0.723948] ntfs: driver 2.1.31 [Flags: R/W].
    [    0.724231] fuse init (API version 7.23)
    [    0.724571] yaffs: yaffs built Installing.
    [    0.724599] msgmni has been set to 1251
    [    0.725748] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
    [    0.725764] io scheduler noop registered (default)
    [    0.753427] pinctrl-single 120f0000.pinmux: 234 pins at pa fe4f0000 size 936
    [    0.757142] brd: module loaded
    [    0.757521] Loading iSCSI transport class v2.0-870.
    [    0.757893] iscsi: registered transport (tcp)
    [    0.870145] ahci 11010000.sata: SSS flag set, parallel bus scan disabled
    [    0.870175] ahci 11010000.sata: AHCI 0001.0300 32 slots 2 ports 6 Gbps 0x3 impl platform mode
    [    0.870187] ahci 11010000.sata: flags: ncq sntf stag pm led clo only pmp fbs slum part ccc sxs boh 
    [    0.871027] scsi host0: ahci_platform
    [    0.871348] scsi host1: ahci_platform
    [    0.871517] ata1: SATA max UDMA/133 mmio [mem 0x11010000-0x11010fff] port 0x100 irq 49
    [    0.871524] ata2: SATA max UDMA/133 mmio [mem 0x11010000-0x11010fff] port 0x180 irq 49
    [    0.872042] hisi-sfc hisi_spi_nor.0: w25x16/s25fl016k (2048 Kbytes)
    [    0.872194] SPI Nand ID Table Version 2.7
    [    0.873269] SPI Nand(cs 1) ID: 0x2c 0x14
    [    0.873293] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x14
    [    0.873298] nand: Micron MT29F1G01ABA
    [    0.873303] nand: 128MiB, SLC, page size: 2048
    [    0.873308] Nand(Auto): OOB:128B ECC:24bit/1k 
    [    0.873321] nand:  ECC provided by Flash Memory Controller
    [    1.050156] libphy: hisi_gemac_mii_bus: probed
    [    1.300158] libphy: hisi_gemac_mii_bus: probed
    [    1.940128] libphy: hisi_own_mii_bus: probed
    [    2.140170] hi_gmac_v200 100a0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 2e:26:e5:41:5d:55
    [    2.330143] attached PHY 1 to driver Generic PHY, PHY_ID=0x600d84a2
    [    2.330473] Higmac dma_sg_phy: 0xa5140000
    [    2.330913] ETH: rgmii, phy_addr=1
    [    2.530171] hi_gmac_v200 100a1000.ethernet (unnamed net_device) (uninitialized): using random MAC address a6:c8:a3:d9:d5:8d
    [    2.610159] attached PHY 8 to driver Generic PHY, PHY_ID=0x8
    [    2.610463] Higmac dma_sg_phy: 0xa5280000
    [    2.610892] ETH: mii, phy_addr=8
    [    2.611040] PPP generic driver version 2.4.2
    [    2.611140] PPP BSD Compression module registered
    [    2.611149] PPP Deflate Compression module registered
    [    2.611167] PPP MPPE Compression module registered
    [    2.611180] NET: Registered protocol family 24
    [    2.611382] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    2.611393] ehci-platform: EHCI generic platform driver
    [    2.611480] ehci-platform 10040000.ehci: EHCI Host Controller
    [    2.611504] ehci-platform 10040000.ehci: new USB bus registered, assigned bus number 1
    [    2.611578] ehci-platform 10040000.ehci: irq 51, io mem 0x10040000
    [    2.630171] ehci-platform 10040000.ehci: USB 2.0 started, EHCI 1.00
    [    2.630686] hub 1-0:1.0: USB hub found
    [    2.630730] hub 1-0:1.0: 2 ports detected
    [    2.631032] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    2.631044] ohci-platform: OHCI generic platform driver
    [    2.631132] ohci-platform 10030000.ohci: Generic Platform OHCI controller
    [    2.631160] ohci-platform 10030000.ohci: new USB bus registered, assigned bus number 2
    [    2.631212] ohci-platform 10030000.ohci: irq 50, io mem 0x10030000
    [    2.694630] hub 2-0:1.0: USB hub found
    [    2.694663] hub 2-0:1.0: 2 ports detected
    [    2.695034] usbcore: registered new interface driver usb-storage
    [    2.695145] usbcore: registered new interface driver usbserial
    [    2.695183] usbcore: registered new interface driver mos7840
    [    2.695217] usbserial: USB Serial support registered for Moschip 7840/7820 USB Serial Driver
    [    2.695358] mousedev: PS/2 mouse device common for all mice
    [    2.695377] i2c /dev entries driver
    [    2.695658] hidraw: raw HID events driver (C) Jiri Kosina
    [    2.695826] usbcore: registered new interface driver usbhid
    [    2.695831] usbhid: USB HID core driver
    [    2.696004] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    2.696060] TCP: cubic registered
    [    2.696588] NET: Registered protocol family 10
    [    2.697499] sit: IPv6 over IPv4 tunneling driver
    [    2.698002] NET: Registered protocol family 17
    [    2.698063] 8021q: 802.1Q VLAN Support v1.8
    [    2.698113] Key type dns_resolver registered
    [    2.698124] Key type ceph registered
    [    2.698536] libceph: loaded (mon/osd proto 15/24)
    [    2.698620] Registering SWP/SWPB emulation handler
    [    2.698690] HIKBASERD: Loading 237KiB [2 disks] into "/home/hikbase.image"... done.
    [    2.700879] /data/jenkins/workspace/Backend-BSP-CCI/8505/opensource/kernel/linux-3.18.20/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    [    2.702324] Freeing unused kernel memory: 1632K (c0620000 - c07b8000)
    [    2.703694] init(1) called reboot syscall, cmd: 0x0.
    [    3.170247] usb 2-2: new low-speed USB device number 2 using ohci-platform
    [    3.402261] input: DaKai 2.4G RX as /devices/soc/10030000.ohci/usb2/2-2/2-2:1.0/0003:0E8F:00A8.0001/input/input0
    [    3.402447] hid-generic 0003:0E8F:00A8.0001: input,hidraw0: USB HID v1.10 Keyboard [DaKai 2.4G RX] on usb-10030000.ohci-2/input0
    [    3.412386] input: DaKai 2.4G RX as /devices/soc/10030000.ohci/usb2/2-2/2-2:1.1/0003:0E8F:00A8.0002/input/input1
    [    3.412735] hid-generic 0003:0E8F:00A8.0002: input,hiddev0,hidraw1: USB HID v1.10 Mouse [DaKai 2.4G RX] on usb-10030000.ohci-2/input1
    [    3.578060] hik_hal: module license 'HIKLICENSE' taints kernel.
    [    3.578077] Disabling lock debugging due to kernel taint
    [    3.579406] [HKBSP]HIK-BSP version #85692[kernel:74730, hikbase:78762] v2.3.2 build 2022-12-14
    [    3.579478] [HKBSP]start parsing ARGS: 'mem=640M console=ttyS0,115200n8 noinitrd ip=ADDR:TFTPADDR:MULTICAST:MASK:Hik-eth:eth0:none '
    [    3.579491] [HKBSP]Ignoring unrecognised tag 0x54410001
    [    3.579496] [HKBSP]Ignoring unrecognised tag 0x54410009
    [    3.579502] [HKBSP]cpldinfo offset[0x100000], size[0x100].
    [    3.579509] [HKBSP]bootparam offset[0x110000], size[0x200].
    [    3.579516] [HKBSP]envinfo offset[0x120000], size[0x1000].
    [    3.579521] [HKBSP]Ignoring unrecognised tag 0x484b0005
    [    3.583783] [HKBSP]Find the platform(K74).
    [    3.584219] Creating 4 MTD partitions on "hinand":
    [    3.584234] 0x000000c00000-0x000003c00000 : "flash_sys0"
    [    3.630457] 0x000003c00000-0x000006c00000 : "flash_sys1"
    [    3.676558] 0x000006c00000-0x000007c00000 : "data_config"
    [    3.692201] 0x000007c00000-0x000008000000 : "rev"
    [    3.696832] SSC board name is DS_80315
    [    3.890329] hik_rtc hik_rtc.0: rtc core: registered hik_rtc as rtc0
    [    4.425514] random: sleep urandom read with 13 bits of entropy available
    [    5.497395] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [    5.575463] UBI: attaching mtd0 to ubi0
    [    5.700127] UBI: scanning is finished
    [    5.703994] UBI: attached mtd0 (name "flash_sys0", size 48 MiB) to ubi0
    [    5.704006] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
    [    5.704012] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
    [    5.704017] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
    [    5.704022] UBI: good PEBs: 384, bad PEBs: 0, corrupted PEBs: 0
    [    5.704027] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    5.704034] UBI: max/mean erase counter: 7/4, WL threshold: 4096, image sequence number: 131538258
    [    5.704039] UBI: available PEBs: 0, total reserved PEBs: 384, PEBs reserved for bad PEB handling: 10
    [    5.704379] UBI: background thread "ubi_bgt0d" started, PID 208
    [    5.710744] UBIFS: background thread "ubifs_bgt0_0" started, PID 211
    [    5.723745] UBIFS: recovery needed
    [    5.763013] UBIFS: recovery completed
    [    5.763030] UBIFS: mounted UBI device 0, volume 0, name "sys0"
    [    5.763038] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [    5.763045] UBIFS: FS size: 45711360 bytes (43 MiB, 360 LEBs), journal size 2285568 bytes (2 MiB, 18 LEBs)
    [    5.763050] UBIFS: reserved for root: 2159060 bytes (2108 KiB)
    [    5.763059] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 30A6A621-DCD0-4036-B240-374BCE3FCD58, small LPT model
    [    5.769545] UBI: attaching mtd1 to ubi1
    [    5.894140] UBI: scanning is finished
    [    5.897971] UBI: attached mtd1 (name "flash_sys1", size 48 MiB) to ubi1
    [    5.897983] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
    [    5.897989] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
    [    5.897994] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
    [    5.897999] UBI: good PEBs: 384, bad PEBs: 0, corrupted PEBs: 0
    [    5.898004] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    5.898011] UBI: max/mean erase counter: 11/6, WL threshold: 4096, image sequence number: 1105190896
    [    5.898016] UBI: available PEBs: 0, total reserved PEBs: 384, PEBs reserved for bad PEB handling: 10
    [    5.898340] UBI: background thread "ubi_bgt1d" started, PID 214
    [    5.904655] UBIFS: background thread "ubifs_bgt1_0" started, PID 217
    [    5.917683] UBIFS: recovery needed
    [    5.961355] UBIFS: recovery completed
    [    5.961374] UBIFS: mounted UBI device 1, volume 0, name "sys1"
    [    5.961381] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [    5.961388] UBIFS: FS size: 45711360 bytes (43 MiB, 360 LEBs), journal size 2285568 bytes (2 MiB, 18 LEBs)
    [    5.961394] UBIFS: reserved for root: 2159060 bytes (2108 KiB)
    [    5.961402] UBIFS: media format: w4/r0 (latest is w4/r0), UUID BC3CD3A0-B8EF-4E08-A7F6-41234BE47A75, small LPT model
    [    5.967882] UBI: attaching mtd2 to ubi2
    [    6.009894] UBI: scanning is finished
    [    6.013551] UBI: attached mtd2 (name "data_config", size 16 MiB) to ubi2
    [    6.013564] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
    [    6.013570] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
    [    6.013575] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
    [    6.013580] UBI: good PEBs: 128, bad PEBs: 0, corrupted PEBs: 0
    [    6.013585] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    6.013592] UBI: max/mean erase counter: 13/8, WL threshold: 4096, image sequence number: 2086548976
    [    6.013597] UBI: available PEBs: 0, total reserved PEBs: 128, PEBs reserved for bad PEB handling: 10
    [    6.013924] UBI: background thread "ubi_bgt2d" started, PID 220
    [    6.020337] UBIFS: background thread "ubifs_bgt2_0" started, PID 223
    [    6.033262] UBIFS: recovery needed
    [    6.083720] UBIFS: recovery completed
    [    6.083740] UBIFS: mounted UBI device 2, volume 0, name "cfg"
    [    6.083747] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
    [    6.083754] UBIFS: FS size: 13205504 bytes (12 MiB, 104 LEBs), journal size 1015809 bytes (0 MiB, 6 LEBs)
    [    6.083760] UBIFS: reserved for root: 623728 bytes (609 KiB)
    [    6.083768] UBIFS: media format: w4/r0 (latest is w4/r0), UUID FCFF6689-D905-4BFD-8A33-BC2290044107, small LPT model
    [    6.132001] [HKBSP] selftests... 
    [    6.132154] Finish!
    [    8.556393] hi_gmac_v200 100a0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
    [    8.565253] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    [   11.560507] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [   11.757855] ata1.00: ATA-9: WDC WD20PURZ-85GU6Y0, 80.00A80, max UDMA/133
    [   11.757871] ata1.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
    [   11.758462] ata1.00: configured for UDMA/133
    [   11.758784] scsi 0:0:0:0: Direct-Access     ATA      WDC WD20PURZ-85G 0A80 PQ: 0 ANSI: 5
    [   11.760287] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
    [   11.760301] sd 0:0:0:0: [sda] 4096-byte physical blocks
    [   11.762210] sd 0:0:0:0: [sda] Write Protect is off
    [   11.762227] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [   11.762356] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [   11.791200]  sda: unknown partition table
    [   11.792271] sd 0:0:0:0: [sda] Attached SCSI disk
    [   12.112617] ata2: SATA link down (SStatus 0 SControl 310)
    [   22.888404] Module himedia: init ok
    [   22.888417] Hisilicon Media Memory Zone Manager
    [   22.888507] hi_osal 1.0 init success!
    [   22.896292] load base.ko ... OK!
    [   22.900178] load sys.ko ...OK!
    [   22.906087] load vdec.ko ....OK!
    [   22.915707] load vdh firmware.ko OK
    [   22.919724] load jpegd.ko ....OK!
    [   22.925578] load tde.ko ...OK!
    [   22.931037] load region.ko ....OK!
    [   22.941232] load vgs.ko ...OK!
    [   22.949213] load vpss.ko ...OK!
    [   22.959877] load vou.ko OK!
    [   23.017070] load hifb.ko OK!
    [   23.024770] load hdmi.ko OK!
    [   23.029631] load rc.ko ...OK!
    [   23.038915] load venc.ko ...OK!
    [   23.042452] load chnl.ko ...OK!
    [   23.046324] load vedu.ko ...OK!
    [   23.051493] load h264e.ko ...OK!
    [   23.056613] load h265e.ko ...OK!
    [   23.061200] load jpege.ko ...OK!
    [   23.067550] load vda.ko ....OK!
    [   23.074297] load ive.ko ... OK!
    [   23.078952] Load hi_cipher.ko success.
    [   23.355131] regIdx 0x0 value 0x21 
    [... SNIP - there were a whole lot of these "regIdx" lines ...]
    [   23.512914] regIdx 0xfe value 0x10ec 
    [   23.512918] *** rt5616 driver init successful! ***
    [   23.516685] load aio.ko OK!
    [   23.521750] load ai.ko OK!
    [   23.527017] load ao.ko OK!
    [   23.532006] load aenc.ko OK!
    [   23.536248] load adec.ko OK!
    [   23.568995] vca encrypt ready!vca_encrypt_major = 246
    [   23.581186] nf_conntrack version 0.5.0 (10037 buckets, 40148 max)
    [   23.635790] iscsid (386): /proc/386/oom_adj is deprecated, please use /proc/386/oom_score_adj instead.
    [   24.243631] hdmi detect retry_times : 0
    [   24.676135] start.sh (230): drop_caches: 3
    [   25.250968] hdmi detect retry_times : 1
    [   26.261000] hdmi detect retry_times : 2
    [   27.271801] hdmi detect retry_times : 0
    [   28.283110] hdmi detect retry_times : 1
    [   29.293141] hdmi detect retry_times : 2
    [   31.444024] hdmi detect retry_times : 0
    [   32.451203] hdmi detect retry_times : 1
    [   33.461234] hdmi detect retry_times : 2
    [   34.471286] hdmi detect retry_times : 0
    [   35.483379] hdmi detect retry_times : 1
    [   36.493412] hdmi detect retry_times : 2
    [   37.533550] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [   37.535794] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
    [   37.537468] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
    [   37.631420] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    [   37.797439] hi_gmac_v200 100a1000.ethernet eth1: Link is Up - 100Mbps/Full - flow control off
    [   37.809626] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
    [   42.217125] [HKBSP][hik_uenv hik_uenv.0][HIKUENV]attemp to create a null passwd!!!
    [   43.222014] [HKBSP][hik_uenv hik_uenv.0][HIKUENV]uboot_env_list_update set bootargs failed -17 
    [   43.381698] hi_gmac_v200 100a0000.ethernet eth0: Link is Down
    [   45.517725] hi_gmac_v200 100a0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
    [   47.233706] vca_encrypt_dbg: vca_encrypt_ioctl: CMD = 0x90
    [   47.233720] vca_encrypt_dbg: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    [   47.233725] vca_encrypt_dbg: before:chip id = 0x0 
    [   47.233731] vca_encrypt_dbg: after:chip id = 0xcc3a6b18 
    [   49.983829] sched: RT throttling activated
    [  163.556621] [HKBSP][hik_uenv hik_uenv.0][HIKUENV]uboot_env_list_update set passwd failed -17 
    [ 1259.955968] recordSysStatIn (642): drop_caches: 3
    [... SNIP - a lot of drop_caches messages ...]
    [51666.442642] recordSysStatIn (642): drop_caches: 3
    [52865.784607] warning: process `taskStartSntpCl' used the deprecated sysctl system call with 1.40.
    [52866.611454] recordSysStatIn (642): drop_caches: 3
    [58549.985638] hi_gmac_v200 100a0000.ethernet eth0: Link is Down
    [58554.239680] hi_gmac_v200 100a0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
    [58867.434429] recordSysStatIn (642): drop_caches: 3
    [... SNIP - more drop_caches messages ...]
    [79270.053948] recordSysStatIn (642): drop_caches: 3
    [80470.201847] recordSysStatIn (642): drop_caches: 3

Wow! We have a full hardware dump!  Anyway, my intent is to either enable SNMP (which this firmware version does NOT have) and/or to allow a regular browser to display the video feed without silly plug-ins.  I can use RTSP to connect to my cameras and view that, but the browser still won't show it.  However, this is the latest version of the software I can find that will actually load on this, so I might indeed be "stuck".

Thursday, October 15, 2026

Removing Basic Auth from Nagios Behind Proxy

I recently installed checkmk to compare checkmk with Nagios (both under Docker and behind a Cloudflare proxy), and found Nagios runs a lot cooler on the CPU side.  So, considering keeping Nagios, I decided I needed to tackle one problem that has been bugging me.

Every time I connect to Nagios through the service, I also get prompted for a username and password via basic authentication.

If I keep Nagios, the above issue is unacceptable.  I need to resolve it.  So, since it is already behind Cloudflare, I know the header is getting there.  That means I simply need to load the rewrite module and ensure the header gets copied into the REMOTE_USER (just in case - may not be needed), and then set the "default_user_name" in cgi.cfg.  So, I grabbed a few files :

    docker cp nagios:/opt/nagios/etc/cgi.cfg cgi.cfg
    docker exec -it nagios cat /etc/apache2/sites-available/nagios.conf

I then modified the nagios.conf file in the following way :

    --- apache-nagios.conf.orig	2026-10-15 16:22:42.366466648 -0600
    +++ apache-nagios.conf	2026-10-15 16:47:12.198454588 -0600
    @@ -7,6 +7,12 @@
     
     ScriptAlias /nagios/cgi-bin "/opt/nagios/sbin"
     
    +# the following two lines are to get the authenticated user into
    +# the REMOTE USER
    +LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
    +RewriteRule .* - [E=REMOTE_USER:%{HTTP:Cf-Access-Authenticated-User-Email}]
    +
    +
     <Directory "/opt/nagios/sbin">
     #  SSLRequireSSL
        Options ExecCGI
    @@ -16,10 +22,10 @@ ScriptAlias /nagios/cgi-bin "/opt/nagios
              Require all granted
     #        Require host 127.0.0.1
     
    -         AuthName "Nagios Access"
    -         AuthType Basic
    -         AuthUserFile /opt/nagios/etc/htpasswd.users
    -         Require valid-user
    +#         AuthName "Nagios Access"
    +#         AuthType Basic
    +#         AuthUserFile /opt/nagios/etc/htpasswd.users
    +#         Require valid-user
           </RequireAll>
        </IfVersion>
        <IfVersion < 2.3>
    @@ -29,10 +35,10 @@ ScriptAlias /nagios/cgi-bin "/opt/nagios
     #     Deny from all
     #     Allow from 127.0.0.1
     
    -      AuthName "Nagios Access"
    -      AuthType Basic
    -      AuthUserFile /opt/nagios/etc/htpasswd.users
    -      Require valid-user
    +#      AuthName "Nagios Access"
    +#      AuthType Basic
    +#      AuthUserFile /opt/nagios/etc/htpasswd.users
    +#      Require valid-user
        </IfVersion>
     </Directory>
     
    @@ -47,10 +53,10 @@ Alias /nagios "/opt/nagios/share"
              Require all granted
     #        Require host 127.0.0.1
     
    -         AuthName "Nagios Access"
    -         AuthType Basic
    -         AuthUserFile /opt/nagios/etc/htpasswd.users
    -         Require valid-user
    +#         AuthName "Nagios Access"
    +#         AuthType Basic
    +#         AuthUserFile /opt/nagios/etc/htpasswd.users
    +#         Require valid-user
           </RequireAll>
        </IfVersion>
        <IfVersion < 2.3>
    @@ -60,9 +66,9 @@ Alias /nagios "/opt/nagios/share"
     #     Deny from all
     #     Allow from 127.0.0.1
     
    -      AuthName "Nagios Access"
    -      AuthType Basic
    -      AuthUserFile /opt/nagios/etc/htpasswd.users
    -      Require valid-user
    +#      AuthName "Nagios Access"
    +#      AuthType Basic
    +#      AuthUserFile /opt/nagios/etc/htpasswd.users
    +#      Require valid-user
        </IfVersion>
    </Directory>

And, I modified the cgi.conf file in the following way :

    --- cgi.cfg.orig	2026-10-15 16:54:45.686779272 -0600
    +++ cgi.cfg	2026-10-15 16:52:28.798266410 -0600
    @@ -105,6 +105,7 @@ use_ssl_authentication=0
     # server will inherit all rights you assign to this user!
      
     #default_user_name=guest
    +default_user_name=nagiosadmin
     
     
    

Now, stop your container, then delete it, and re-run adding two new parameters to map those files into place.

And, you should no longer prompt for authentication after already authenticating. 

Trying Checkmk under Docker

Please note this up front - when I installed checkmk under Docker, I did a comparison on CPU utilization between checkmk and Nagios, and the comparison (while not apples-to-apples, simply because Nagios checks on a per-minute basis, while checkmk looks like it is grabbing a lot more with regularity) is not close.  Both containers run with 4 "CPU's", so that is a direct comparison.


It appears that the checkmk runs a lot hotter than Nagios itself.  Sure, it is a much nicer interface, and it also potentially exposes things through a livestatus API in ways that might be better (I haven't played with it), but it is still a much busier application.  Proceed with that being a known point.

NetworkChuck rolled a video about a "new" monitoring package called "Checkmk".  It was actually fairly intriguing, as it uses a web-based configuration front-end (don't need to change monitoring using the command-line with a restart).  The video : 

https://www.youtube.com/watch?v=Bjifz55TTPI

Now, some of the added stuff is that it looks like a much nicer integration with metrics, not just the CRITICAL/WARNING/OK/UNKNOWN status.  I have started using docker a LOT more lately, just because it might allow things to be portable if I have to move to new hardware, or if I want to update.  So, we'll give this one a shot.  Let's see if we can do this.

It took me a few commands to find out how the image starts and what ports to forward, because nothing about it was intuitive.  So, after starting the image without it, I found a nice little command that dumps the TCP ports of the container itself.  We can use that to figure out the port to forward using trial and error, frankly.

    [username@dockerhost ~]$ docker container inspect checkmk --format '{{json .Config.ExposedPorts}}'
    {"5000/tcp":{},"6557/tcp":{},"80/tcp":{}}
    [username@dockerhost ~]$

This told me it listens on ports 5000, 6557, and 80 (Apache's HTTPd, if I've read the documentation properly).  Unfortunately, port 80 didn't actually work like I anticipated when I forwarded that.  So, I had to delete the container, and then re-create it.  The  command to start it for me :

    [username@dockerhost ~]$ docker run --name checkmk -d -p 0.0.0.0:5000:5000 checkmk/check-mk-community
    1b54e26451cc125f2a26b1298a9cfdf9a3b3843ecd3f142dc968c17ffd54acb9
    [username@dockerhost ~]$
    

It dumps the container ID, and the -d tells it to run it in the background. I recommend you then grab the logs, because the first run dumps some information we're going to need such as the default username and password (this password is NOT consistent between images - you really need to obtain that).

    [username@dockerhost ~]$ docker logs checkmk -f
    ### CREATING SITE 'cmk'
    Adding /opt/omd/sites/cmk/tmp to /etc/fstab.
    Going to set TMPFS to off.
    Preparing tmp directory /omd/sites/cmk/tmp...Generating configuration for core (type nagios)...
    Precompiling host checks...OK
    Executing post-create script "01_create-sample-config.py"...OK
    Executing post-create script "02_message-broker-certs"...OK
    Updating core configuration...
    Adding /opt/omd/sites/cmk/tmp to /etc/fstab.
    Going to set TMPFS to off.
    Skipping Apache restart.
    Created new site cmk with version 2.5.0p15.community.
    
      The site can be started with omd start cmk.
      The default web UI is available at http://1b54e26451cc/cmk/
    
      The admin user for the web applications is cmkadmin with password: Bo06iHX7qugF
      For command line administration of the site, log in with 'omd su cmk'.
      After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'.
    
    ### STARTING XINETD
     * Starting internet superserver xinetd
       ...done.
    ### STARTING SITE
    Preparing tmp directory /omd/sites/cmk/tmp...Starting agent-receiver...OK
    Starting mkeventd...OK
    Starting rrdcached...OK
    Starting redis...OK
    Starting npcd...OK
    Starting automation-helper...OK
    Starting ui-job-scheduler...OK
    Starting nagios...OK
    Starting apache...OK
    Starting crontab...OK
    ### STARTING CRON
    ### CONTAINER STARTED
    ^C[username@dockerhost ~]$

What you want is the line that starts with "The admin user for the web applications" (I highlighted it in the example I'm working through).  It tells you the username, and the password you are going to need. Get this logged into your password manager.

Now, since I added the port forwarding of 5000 to 5000, I point to my docker host on port 5000, and was then presented with the login.  Entering the credentials from above gives me the wizard to create my first host (I could create a folder - I skipped that).

Monitoring our first host 

The first host I created was my NAS, because I do want to add docker stuff, and I want to port my Nagios into this thing as well. This should let me see how the metrics differ between the two.  I saw the "Problems with 1 data source detected", and immediately panicked.

Breathe, ya big nerd. It means that the agent connection failed, and I had ensured that was NOT connected (it wasn't checked on the form).  No worries.

Well, you can go back and check the box for that checkmk agent thing, and then select the "No API integrations, no checkmk agent" option, save, and re-scan.

I scanned down the list below that big scary error message, and found that it looks like it did pick up everything via SNMP, except for the temperature.  I could add the "undecided" in that list by clicking the "Monitor undecided services".  But, I opted to keep it fairly clean, and only added CPU, fans, memory, RAID status, and the volume that runs on the RAID.  Just click the green "plus" right next to  the undecided monitor you want.

Once you have them selected, you should see a "Changes" on the right side with a yellow number.  It simply means you have to click in there when you are done and activate the pending changes.

We are now monitoring our first "host".

Getting everything into checkmk

Now, as often as I searched the Googles for "migrating from Nagios to Checkmk", they all simply talked about manually putting in the hosts - e.g., there are no real tools built for migration to make it one fell swoop.  So, since the Docker instance of Nagios has all hosts in one single file in my configuration, I found that I could simply grab the unique hostnames from custom.cfg .

    grep host_name /opt/docker/nagios/etc/objects/custom.cfg |awk '{print $2}'|sort|uniq

This gave me a quick list of hostnames to add. What makes this easy is that you can just add the agent, then point to the new host, and then have it look.  We'll do that with docker, just for the sanity.  On the left, click "Setup", followed by "Linux" under "Agents".  Then, right click on the RPM (I'm doing this with RHEL), and copy the link.

Then, on your docker host, run "wget " and paste the URL, e.g. :

    [username@dockerhost nagios]$ wget http://dockerhost:5000/cmk/check_mk/agents/check-mk-agent-2.5.0p15-1.noarch.rpm
    --2026-10-14 17:23:53--  http://docker:5000/cmk/check_mk/agents/check-mk-agent-2.5.0p15-1.noarch.rpm
    Resolving docker (docker)... 192.168.1.219
    Connecting to docker (docker)|192.168.1.219|:5000... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 5877930 (5.6M) [application/x-redhat-package-manager]
    Saving to: ‘check-mk-agent-2.5.0p15-1.noarch.rpm’
    
    check-mk-agent-2.5.0p15-1.noarch.rpm 100%[======================================================================>]   5.61M  --.-KB/s    in 0.02s   
    
    2026-10-14 17:23:53 (348 MB/s) - ‘check-mk-agent-2.5.0p15-1.noarch.rpm’ saved [5877930/5877930]
    
    [username@dockerhost nagios]$

Now install it using "sudo rpm -ivh check-mk-agent-2.5.0p15-1.noarch.rpm".  Mine gave me a bright-red error about "Failed to reload xinetd.service: Unit xinetd.service not found.", but it had no impact (utilizes systemd now, and RHEL9 has NOTHING to support xinetd, anyway).

On that setup->agents side bar again, select "Other operating systems", and find the mk_docker.py under "Plug-ins".  RIght click on it, and copy the link.  Then, wget that again on your docker host to copy the plug-in down.  Install it :

    sudo install -m 0755 mk_docker.py /usr/lib/check_mk_agent/plugins/

Also make sure the Python module is installed :

    sudo yum install python3-docker.noarch

Download the example configuration file (the same way we downloaded the agent - from the browser, get to "Setup" -> "Agents" -> "Linux", and search for "docker.cfg".  Right click on that, copy the link, then in a shell on the docker host, run "wget URL" (paste the URL in place of the URL, right?).  Copy this into the /etc/check_mk directory on your docker host.

Enter the host in the hostname field, select the "Checkmx agent" under "Monitoring agents", and then click the test-connection to the right.  It should say it was successful.  If so, click the "Save & run service discovery".

Now, re-scan or perform a service discovery. 

In Checkmk, create a new folder for your docker containers ("Setup"->"Hosts"->"Add folder").  I named my folder "Docker Containers", because I have a simple mind.  If you don't have the "IP address family" checkbox showing, expand the "more settings" on the "Network address", and check the box for "IP address family", and then set the dropdown to "No IP".  Under "Monitoring agents", check the override for the "Check mkagent / API integrations", and then select "no API integrations, no checkmk agent".  If you don't see the "piggy back" option, hit the more on the right again.  Under piggy back, select it, then choose the "Always use and expect piggy back data", and hit save.

Let's get a list of container names now.  In a shell on the docker host, run a command to show them all.

    [username@dockerhost ~]$ docker ps --format '{{.Names}}'
    checkmk
    httpd
    nagios
    grafana
    cloudflare
    mqtt
    mysql-container
    [username@dockerhost ~]$

Copy the names of your hosts.

The next step is to click back into "Setup"->"Hosts", and then into the "Docker Containers" folder.  From there, click the "Hosts" at the top, followed by the "Import hosts via CSV file".

Paste the list of hosts into your contents box, and then throw a "hostname" at the top of the list (it needs a header row), click the "Perform automatic service discovery" box, then click "Upload".

Next, make sure the CSV has recognized the "host name" column, then click on the "Import" button that shows up.  Note, this screen shot has an ugly error message because I missed the hostname assignment field due to me not knowing that it needed a header row.  I only noticed when I realized I was missing a container name.

Click the "Start" button, then wait for it to finish, and then do the usual "Changes"->"Activate pending changes" step.

Give it time, and it should load all the information on your docker containers.

The Lazy Way - Scanning The Network

By this point, my second-grader attention span has waned, and I'm just "done".  So, I went into the "hosts" from under "setup", and added a folder, and enabled a network scan for my non-Internet-routeable setup.  I did specify the IP range for that network, and then I went all "Frozen" on it and "just let it go".  Eventually pulled everything up.

Setting This Up To Use A Proxied Authentication

Now for my big frustration with Nagios in docker - I would have had to really hack to get REMOTE_USER in as the user you are in for it.  It continually asked for authentication via Basic-Auth, even after performing the Cloudflare authentication.  I REALLY wanted to keep it tied to who you actually authenticated with (auditing).  Here's how.

Log in to your Checkmk instance.  Go into the Users, and add a user in the format your proxy provides (e.g. e-mail address).

Then, under "Setup", under "General", should be a "global settings". Expand "User interface", and locate the "Authenticate users by incoming HTTP requests".

Next, check the box for "Activate HTTP header authentication", and in the "HTTP request header variable" field that pops up, enter the header name used by your access manager/proxy.

If you have Cloudflare in front of it, you would use "Cf-Access-Authenticated-User-Email" for the header.  Save that.

Now you can do into the Cloudflare portal and create a new hostname/mapping, and you have access through your portal.