public static function writeRouterInfo($zone, $zoneinfo) { if (self::$init === false) { self::init(); } NagRedis::set(md5('cdcroutervms:' . $zone), $zoneinfo); }
public static function setDeploymentHostAuditInfo($deployment, $deploymentInfo) { if (self::$init === false) { self::init(); } NagRedis::set(md5('deployment:' . $deployment) . ':hostaudit', $deploymentInfo); }
public static function delDeploymentStaticHost($deployment, $ip) { if (self::$init === false) { self::init(); } $hostInfo = array(); if (preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $ip)) { $ip = NagMisc::encodeIP($ip); } $staticHosts = NagRedis::get(md5('deployment:' . $deployment) . ':statichosts'); $staticHosts = json_decode($staticHosts, true); if (isset($staticHosts[$ip]) && !empty($staticHosts[$ip])) { $hostInfo = $staticHosts[$ip]; unset($staticHosts[$ip]); NagRedis::set(md5('deployment:' . $deployment) . ':statichosts', json_encode($staticHosts)); $hostData = new DeploymentHostData($deployment, 'del', 'static', $hostInfo); self::$log->addToLog($hostData); } return $hostInfo; }