diff --git a/app/Console/Commands/ShjSixCommand.php b/app/Console/Commands/ShjSixCommand.php deleted file mode 100644 index fc89db4..0000000 --- a/app/Console/Commands/ShjSixCommand.php +++ /dev/null @@ -1,129 +0,0 @@ -shjSixService = $shjSixService; - } - - /** - * コンソールコマンドを実行 - * - * 処理フロー: - * 1. サーバ死活監視(DBアクセス) - * 2. デバイス管理マスタを取得する - * 3. デバイス毎のハードウェア状態を取得する - * 4. プリンタ制御プログラムログを取得する - * 5. バッチ処理ログを作成する - * ※ 異常検出時は共通A処理(メール通知)を実行 - * - * @return int - */ - public function handle() - { - try { - // 開始ログ出力 - $startTime = now(); - $this->info('SHJ-6 サーバ死活監視処理を開始します。'); - - Log::info('SHJ-6 サーバ死活監視処理開始', [ - 'start_time' => $startTime - ]); - - // SHJ-6監視処理実行 - $result = $this->shjSixService->executeServerMonitoring(); - - // 処理結果確認 - if ($result['success']) { - $endTime = now(); - $this->info('SHJ-6 サーバ死活監視処理が正常に完了しました。'); - $this->info("処理時間: {$startTime->diffInSeconds($endTime)}秒"); - $this->info("監視結果: {$result['monitoring_summary']}"); - - // 警告がある場合は表示 - if (!empty($result['warnings'])) { - $this->warn('警告が検出されました:'); - foreach ($result['warnings'] as $warning) { - $this->warn("- {$warning}"); - } - } - - Log::info('SHJ-6 サーバ死活監視処理完了', [ - 'end_time' => $endTime, - 'duration_seconds' => $startTime->diffInSeconds($endTime), - 'result' => $result - ]); - - return self::SUCCESS; - } else { - $this->error('SHJ-6 サーバ死活監視処理でエラーが発生しました: ' . $result['message']); - - // エラー詳細があれば表示 - if (!empty($result['error_details'])) { - $this->error('エラー詳細:'); - foreach ($result['error_details'] as $detail) { - $this->error("- {$detail}"); - } - } - - Log::error('SHJ-6 サーバ死活監視処理エラー', [ - 'error' => $result['message'], - 'details' => $result['error_details'] ?? null - ]); - - return self::FAILURE; - } - - } catch (\Exception $e) { - $this->error('SHJ-6 サーバ死活監視処理で予期しないエラーが発生しました: ' . $e->getMessage()); - Log::error('SHJ-6 サーバ死活監視処理例外エラー', [ - 'exception' => $e->getMessage(), - 'trace' => $e->getTraceAsString() - ]); - - return self::FAILURE; - } - } -}