logcolstat.cmd 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. @Echo off
  2. SetLocal EnableDelayedExpansion
  3. SetLocal EnableExtensions
  4. set v_product=%1
  5. set v_finalcheck=%2
  6. if exist DB_sql_*00*.log (
  7. if "%v_product%"=="DB" ( if "%v_finalcheck%" NEQ "YES" (
  8. For %%a in (DB_sql_*00*.log) do (
  9. findstr /R /C:"DB: CT-[0-9]*: COLLECTED:" %%a>> DB_collected.log
  10. )
  11. For %%a in (DB_sql_*00*.log) do (
  12. findstr /R /C:"DB: CT-[0-9]*: WARNING:" %%a>> DB_warnings.log
  13. )
  14. For %%a in (DB_sql_*00*.log) do (
  15. findstr /R /C:"DB: CT-[0-9]*: ERROR:" %%a>> DB_errors.log
  16. )
  17. )
  18. )
  19. )
  20. if "%v_product%"=="DB" ( if "%v_finalcheck%"=="YES" (
  21. for /f "delims=" %%a in ('FINDSTR /R /N "^.*$" db_list.csv ^| FIND /C ":"') do (
  22. if %%a==1 ( echo DB: CT-02808: WARNING: There are no DB instances running on this machine >> DB_warnings.log )
  23. )
  24. )
  25. )
  26. if exist EBS_sql_*00*.log (
  27. if "%v_product%"=="EBS" ( if "%v_finalcheck%" NEQ "YES" (
  28. For %%a in (EBS_sql_*00*.log) do (
  29. findstr /R /C:"EBS: CT-[0-9]*: COLLECTED:" %%a>> EBS_collected.log
  30. )
  31. For %%a in (EBS_sql_*00*.log) do (
  32. findstr /R /C:"EBS: CT-[0-9]*: WARNING:" %%a>> EBS_warnings.log
  33. )
  34. For %%a in (EBS_sql_*00*.log) do (
  35. findstr /R /C:"EBS: CT-[0-9]*: ERROR:" %%a>> EBS_errors.log
  36. )
  37. )
  38. )
  39. )
  40. endlocal