Created
July 28, 2017 05:48
-
-
Save Akkiesoft/cdbb30259fd502d4f8f5d2a6c6244911 to your computer and use it in GitHub Desktop.
何にも再利用できないゴミ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = file("nyan.txt", FILE_IGNORE_NEW_LINES); | |
$renhou = array(); | |
foreach($a as $i) { | |
$pon = explode("#", $i); | |
$toyoda = explode("_", $pon[0]); | |
$inada = explode(",", $pon[2]); | |
$renhou[$toyoda[1]][$toyoda[0]][$toyoda[2]][$inada[0]] = $inada[1]; | |
} | |
$suga = array("", "system", "storage", "updates", "audit", "config"); | |
$daemon = array("", "critical", "warning", "info"); | |
$zeikin = array( | |
'Email' => "email", | |
'OSLog' => "OSLog", | |
'IPMI' => "ipmi", | |
'SNMP' => "snmp", | |
'SysLog' => "remotesyslog", | |
'WSEventing' => "ws-events", | |
); | |
$cnt = 1; | |
foreach($renhou as $jimin=>$abe) { | |
foreach($abe as $nikai=>$aso) { | |
foreach($aso as $kakka=>$rosen) { | |
$action = ""; | |
foreach($rosen as $yosan=>$junn) { | |
if (0 < $junn) $action .= $zeikin[$yosan].","; | |
} | |
$action = (! $action) ? "none" : substr($action, 0, -1); | |
print <<<EOM | |
[idrac.alert.$cnt] | |
category={$suga[$jimin]} | |
severity={$daemon[$kakka]} | |
subcategory={$nikai} | |
action={$action} | |
EOM; | |
$cnt++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment