$data = @{
    'AOS' = @(
        'Ax32Serv Process'
        'IFS Customer Counter'
        'IFS Hotlist Counter'
    )


    'BCM' = @(
        'BCM to DWH Upload Failure'
        'CardClosure TCS Not Available'
        'IFS Agent List Counter'
        'IFS Action List Counter'
        'IFS Blacklist Primary Card'
        'IFS Blacklist Primary Range'
        'IFS Blacklist Primary Device'
        'IFS Blacklist Secondary'
        'IFS Blacklist Secondary Card'
        'IFS Blacklist Secondary Range'
        'IFS Blacklist Secondary Device'
        'RCOB Import Directory Count'
        'RCOB Export Directory Count'
        'RCOB Import Files Duplicate'
        'CardCheck Rejsekort Sale'
        'EOD Generation Action List'
        'EOD Generation Primary Blacklist'
        'EOD Generation Secondary Blacklist'
        'CardClosure'
        'Open Refund List'
    )
    
    'CAC' = @(
        'Cache Statistics'
    )
    
    'HKP' = @(
        'HKP Overall'
    )

    'INT' = @(
        'MailQueue'
        'FTP Batch Reports'
        'FTP Batch Exports'
    )

    'MDL' = @(
        'Incoming Not Processed'
        'Incoming Files Age'
        'Incoming Files Queue'
        'IFS Waiting Events'
    )

    'REPORTS' = @(
        '...'
    )

    'SPS' = @(
        'Outgoing EFTLogs Queue'
        'EOD Distribution Action List'
        'EOD Distribution Primary Blacklist'
        'EOD Distribution Secondary Blacklist'
        'Connected Equipment'
    )

    'SQL' = @(
        'Job Execution Backup'
        'Job Execution DB Integrity Check'
        'Job Execution Index Optimization'
        'Job Execution DBA Info Collector'
        'Job Execution Archiving'
        'Performance Check General'
        'Performance Check Locks'
        'Performance Check Memory'
        'Performance Check Waits'
        'Performance Check Buffer'
        'Performance Check Statistics'
        'Performance Check Cache'
        'Logfile Usage'
        'File Usage'
    )

    'SQL-AX' = @(
        'EntityLog'
        'LongRunning Exec'
        'Session EndBlocked'
    )

    'SQL-AX-JOBS' = @(
        'CPR ZipCode Update'
        'Unblock Blocked CPR'
        'Accruals Export'
        'EntityLog Export'
        'NonPersistent Entities Export'
        'Persistent Entities Export'
        'Open Payments Export'
        'POM Transaction Creation'
        'Purge BatchHistory Parameters'
        'Purge BatchHistory Records'
        'Update Performance Counters'
        'CPR Customer Address Update'
    )

    'SQL-MSBI' = @(
        'Active Node MSBI vs PDB'
    )

    'SQL-PDB' = @(
        'Duplicate CWS Username'
        'Frequent Travellers'
        'TRK'
        'Job Execution IFS Auditing'
        'Job Execution IFS Tracking'
        'Unprocessed TCS Transactions'
        'Last CWS Purse Reload'
    )

    'TCS' = @(
        'BORIS Connection Count'
        'BORIS Shift Count'
        'FSV Outgoing File Age'
    )

    'WEB' = @(
        'IIS Connections'
        'IIS Users'
        'IIS Requests'
        'IIS Transfers'
    )

    'WEB-BO' = @(
        'BackOffice Website'
    )

    'WEB-BORIS' = @(
        'BORIS Website'
    )

    'WEB-CWS' = @(
        'CWS Website'
    )

    'XPS' = @(
        'Outgoing File Queue'
        'Outgoing Logbooks Queue'
    )
}

$etoloutput = foreach($key in ($data.keys | sort)) {
    "<h3 id=`"$key`">$key</h3>"
    
    $array = $data[$key]
    foreach($item in $array) {
        #"<h2>$item</h2>"
        #"<a id=`"$item`"></a>"

        "<h2 id=`"$item`">$item</h2>"
    }
}

#https://e-ecm.thalesgroup.com/livelink/livelink.exe?func=ll&objId=6398950&objAction=WikiView#Duplicate CWS Username
$nagiosoutput = foreach($key in ($data.keys | sort)) {
    #"<h3 id=`"$key`">$key</h3>"
    
    $array = $data[$key]
    foreach($item in $array) {
        @{
            title = "SISOP - $item"
            description = $item
            actions = @(
                "<a href=`"https://e-ecm.thalesgroup.com/livelink/livelink.exe?func=ll&objId=6398950&objAction=WikiView#$item`">E-TOL WIKI - $item</a>"
            )
        }
    }
}

$nagiosoutput | ConvertTo-Json