fork download
  1. earliest=`macro_infra360host_mssqldb_search_general_tier3_earliest` latest=`macro_infra360host_mssqldb_search_general_tier3_latest`
  2. `macro_infra360host_mssqldb_tier1`
  3. AND `macro_infra360host_mssqldb_search_whitelist_perfmon_tier1`
  4. | stats latest(Value) AS Value
  5. BY host object counter instance
  6. | eval counter=if( counter="Transaction Delay" AND object="SQLServer:Database Replica", "Transaction Delay (Mins)", counter)
  7. | eval Value =if( counter="Transaction Delay" AND object="SQLServer:Database Replica" , Value/60000, Value)
  8. | eval host=upper(host)
  9.  
  10. | join type=left host
  11. [
  12. | search `macro_acn_server_information` (`macro_acn_server_information_constraint_windows` OR `macro_acn_server_information_constraint_linux` OR `macro_acn_server_information_constraint_aix`) earliest=-20m@m
  13. | eval TotalPhysicalMemory_GB=round(TotalPhysicalMemoryKB/(1024*1024),3)
  14. | stats latest(TotalPhysicalMemory_GB) AS TotalPhysicalMemory_GB BY host
  15. | eval host=upper(host)
  16. ]
  17.  
  18. | eval total_physical_memory_flag = if(isnull(TotalPhysicalMemory_GB) AND object="SQLServer:Buffer Manager" AND counter="Page life expectancy" AND instance="0","1","0")
  19. | fillnull value=1 total_physical_memory_flag
  20. | eval Value = case( object="SQLServer:Buffer Manager" AND counter="Page life expectancy" AND instance="0" AND total_physical_memory_flag=0, (Value / ((TotalPhysicalMemory_GB/`macro_infra360host_mssqldb_expected_page_life_memory_divider`) * `macro_infra360host_mssqldb_expected_page_life_value` ))
  21. , object="SQLServer:Buffer Manager" AND counter="Page life expectancy" AND instance="0" AND total_physical_memory_flag=0 AND isnotnull(Value) AND (total_physical_memory_flag=1 OR isnull(total_physical_memory_flag)) , "TBC"
  22. , 1=1, Value)
  23. | eval counter = if(object="SQLServer:Buffer Manager" AND counter="Page life expectancy" AND instance="0","Expected page life ratio",counter)
  24.  
  25. | append
  26. [| search earliest=`macro_infra360host_mssqldb_search_general_tier3_earliest` latest=`macro_infra360host_mssqldb_search_general_tier3_latest` `macro_infra360host_mssqldb_tier1` AND `macro_infra360host_mssqldb_search_whitelist_perfmon_tier1_tlog`
  27. | eventstats latest(_time) AS event_time_epoch BY host instance
  28. | eval compound_key = host + "___" + instance + "___" + event_time_epoch
  29. | chart limit=0 max(Value) BY compound_key counter
  30. | eval Value= 100 * ( 'Log File(s) Used Size (KB)' / 'Log File(s) Size (KB)' )
  31. | fillnull value=0 Value
  32. | rex field="compound_key" "(?<host>^.*?)___(?<instance>.*?)___(?<event_time_epoch>.*?)$"
  33. | eval object = "SQLServer:Databases"
  34. | eval counter = "% TLog Utilisation" ]
  35. | table _time host object counter instance Value
  36. | eval _time = relative_time(now(), `macro_infra360host_mssqldb_search_general_tier3_latest`)
  37. | rename host AS source_host
  38.  
  39. | eval source_host=if (isnull(source_host), upper(host), upper(source_host))
  40. | stats latest(_time) AS latest_time latest(Value) AS latest_value avg(Value) AS avg_value max(Value) AS max_value min(Value) AS min_value count(Value) AS count_value BY source_host object counter instance
  41. `macro_fields_information_common`
  42. | appendpipe [
  43. | table source_host instance
  44. | eval metric_value=0
  45. | append [
  46. | inputlookup lookup_static_list_infra360host_mssqldb
  47. | search show_offline_flag=1
  48. | rename key AS source_host
  49. ]
  50. | stats last(metric_value) AS metric_value BY source_host
  51. | fillnull value="1" metric_value
  52. | fillnull value="N/A" instance
  53. | eval object="Infra MSSQLDB"
  54. | eval counter="Reporting no data"
  55. | eval tower="Infra MSSQLDB reporting no data"
  56. ]
  57.  
  58. | eval metric_label = object + " : " + counter
  59. | eval metric_value=case( isnum(metric_value) AND object="PhysicalDisk" , round(metric_value,6) , isnum(metric_value) , round(metric_value,3) , 1=1 , metric_value )
  60. | eval metric_unit=case(isnull(metric_unit) AND isnull(counter),OTHER, isnull(metric_unit),counter, 1=1,metric_unit)
  61. `macro_blacklist_common`
  62. `macro_manual_thresholds_override_common`
  63. | lookup lookup_db_cluster_infra360host_mssqldb host AS source_host OUTPUT db_cluster
  64. | eval db_cluster=if( isnull(db_cluster) , "OTHER" , upper(db_cluster) )
  65. | eval db_rep_data=0
  66. `macro_infra360host_mssqldb_search_primary_db`
  67. `macro_infra360host_mssqldb_search_db_replication_delay`
  68. | where (db_rep_data=0 AND counter!="Transaction Delay (Mins)") OR db_rep_data=1
  69. | lookup lookup_automated_thresholds_db_perfmon_monitoring source_host object counter instance OUTPUT threshold1 threshold2 threshold3 threshold4
  70. | foreach "threshold*"
  71. [ eval <<FIELD>> = if ( use_manual_threshold=0 , <<FIELD>>, manual_<<FIELD>>)]
  72. | `dynamic_thresholds_set_default_threshold_values`
  73. `macro_alert_value_common`
  74. | table source_host metric_label instance metric_value alert_value threshold1 threshold2 threshold3 threshold4 blacklist_alerts tower metric_unit add_info
  75. | eval _time = relative_time(now(), `macro_infra360host_mssqldb_search_general_tier3_latest` )
Runtime error #stdin #stdout #stderr 0.01s 4316KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
wspace: user error (Can't do Dup)