Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $script:Debug=$true
- $script:sql_primary = "194.58.37.45"
- $script:sql_pass = "***
- $script:sql_user = "***"
- $script:sql_bd = "zakupki360"
- #$script:zabbix_server="11111.compute-1.amazonaws.com"
- $script:zabbix_server="192.168.1.100"
- function delimmsg
- {
- logmsg " "
- logmsg " "
- logmsg "==============================================================================================="
- sleep 2
- }
- function logmsg
- {
- Param([string]$msg)
- $date=get-date
- $msg_text=""
- $msg_text=$date.tostring("yyyy-MM-dd hh:mm:ss")
- $msg_text+="`t"
- $msg_text+=$msg
- if ($script:debug) {write-host $msg_text }
- }
- function zabbix_send{
- Param([string]$zsrv, [string]$key,[string]$QueryText)
- logmsg "key : $key"
- $flag=sql_exec $QueryText
- if ( $flag -ne "FALSE" )
- {
- logmsg "value: $flag"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -v -s $zsrv -z $script:zabbix_server -k $key --value $flag
- popd
- }
- else
- {
- logmsg "FAIL"
- }
- delimmsg
- }
- function sql_exec{
- param([string]$QueryText)
- $constr = "Password=" + $script:sql_pass + ";User ID=" + $script:sql_user + ";Initial Catalog=" + $script:sql_bd + ";Data Source=" + $script:sql_primary
- $SqlConnection = new-object System.Data.SqlClient.SqlConnection
- $SqlConnection.ConnectionString = $constr
- $SqlCommand = $SqlConnection.CreateCommand()
- $SqlCommand.CommandText = $QueryText
- $SqlCommand.CommandTimeout = 300
- try{
- #logmsg "connect to $constr"
- $DataAdapter = new-object System.Data.SqlClient.SqlDataAdapter $SqlCommand
- $dataset = new-object System.Data.Dataset
- $SqlConnection.Close()
- $tst=$DataAdapter.Fill($dataset)
- $SqlConnection.Close()
- $flag = $dataset.Tables[0].Rows[0][0]
- }catch{
- logmsg "sql connection FAIL"
- return "FALSE"
- }
- logmsg "SQL : $flag"
- return $flag
- }
- function sphinx_check{
- Param([string]$zsrv, [string]$key, [string]$srv, [string]$port, [string]$uppubdate, [string]$period, [string]$stage)
- logmsg "key : $key"
- try{
- $flagv=C:\applications\SphinxWatcher\SphinxWatcher.exe -h $srv -p $port --date $uppubdate --period $period --stage $stage
- }catch{
- write-host "ail to execute"
- }
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function sphinx_check_2{
- Param([string]$zsrv, [string]$key, [string]$srv, [string]$port, [string]$uppubdate, [string]$period, [string]$stage)
- logmsg "key : $key"
- try{
- $flagv=C:\applications\SphinxWatcher\SphinxWatcher.exe -h $srv -p $port --date $uppubdate --period $period --law $stage
- }catch{
- write-host "Fail to execute"
- }
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- #.\zabbix_sender.exe -vv -s "orders" -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function pacts_check{
- Param([string]$zsrv, [string]$key, [string]$datefilter, [string]$period)
- logmsg "key : $key"
- pushd
- cd "C:\applications\ZakupkiPactWatcher\"
- $flagv=.\ZakupkiPactWatcher.exe --date $datefilter --period $period
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function fabrikant_check_double{
- Param([string]$zsrv, [string]$key1, [string]$key2)
- logmsg "key : $key1"
- logmsg "key : $key2"
- pushd
- cd "C:\applications\FabrikantWatcher\"
- $flagv=.\FabrikantWatcher.exe
- $flagv = $flagv -split "_"
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key1 --value $flagv[0]
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key2 --value $flagv[1]
- popd
- delimmsg
- }
- function etpgpb_check{
- Param([string]$zsrv, [string]$key)
- logmsg "key : $key"
- pushd
- cd "C:\applications\ETPGPB_Watcher\"
- $flagv=.\Integration.Etpgpb.Watcher.exe
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- .\zabbix_sender.exe -vv -s "orders_staging" -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function etprf_check_double{
- Param([string]$zsrv, [string]$key)
- logmsg "key : $key"
- pushd
- cd "C:\applications\EtprfWatcher\"
- $flagv=.\EtprfWatcher.exe
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- .\zabbix_sender.exe -vv -s "orders_staging" -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function b2b_check_double{
- Param([string]$zsrv, [string]$key)
- logmsg "key : $key"
- pushd
- cd "C:\applications\B2BWatcher\"
- $flagv=.\B2BWatcher.exe
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- .\zabbix_sender.exe -vv -s "orders_staging" -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function estp_check_double{
- Param([string]$zsrv, [string]$key1, [string]$key2)
- logmsg "key : $key1"
- logmsg "key : $key2"
- pushd
- cd "C:\applications\estpWatcher\"
- $flagv=.\estpWatcher.exe
- $flagv = $flagv -split "_"
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key1 --value $flagv[0]
- .\zabbix_sender.exe -vv -s "orders" -z $script:zabbix_server -k $key1 --value $flagv[0]
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key2 --value $flagv[1]
- .\zabbix_sender.exe -vv -s "orders" -z $script:zabbix_server -k $key2 --value $flagv[1]
- popd
- delimmsg
- }
- function akd_check_double{ # Somebody created wrong name for utility and make missunerstanding. It's bad.
- Param([string]$zsrv, [string]$key)
- logmsg "key : $key"
- pushd
- cd "C:\applications\AkdWatcher\"
- $flagv=.\Integration.Akd.Watcher.exe
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key --value $flagv
- .\zabbix_sender.exe -vv -s "orders_staging" -z $script:zabbix_server -k $key --value $flagv
- popd
- delimmsg
- }
- function otc_check_double{
- Param([string]$zsrv, [string]$key1, [string]$key2)
- logmsg "key : $key1"
- logmsg "key : $key2"
- pushd
- cd "C:\applications\OTCWatcher\"
- $flagv=.\Integration.OTC.Watcher.exe
- $flagv = $flagv -split "_"
- popd
- logmsg "value: $flagv"
- pushd
- cd "C:\Program Files\zabbix\bin\win64\"
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key1 --value $flagv[0]
- .\zabbix_sender.exe -vv -s "orders" -z $script:zabbix_server -k $key1 --value $flagv[0]
- .\zabbix_sender.exe -vv -s $zsrv -z $script:zabbix_server -k $key2 --value $flagv[1]
- .\zabbix_sender.exe -vv -s "orders" -z $script:zabbix_server -k $key2 --value $flagv[1]
- popd
- delimmsg
- }
- while($true)
- {
- #zabbix_send "orders_staging" "Plans.Published.Staging.MsSQL.Day" "select count(*) from [dbo].[PlanSchedules] ps with(nolock) left join [dbo].[PlanPositions] pp with(nolock) on ps.Id = pp.[PlanScheduleId] where ps.PublishDate >= convert (date, getutcdate())"
- #zabbix_send "orders_staging" "Plans.Published.Staging.MsSQL.Month" "select count(*) from [dbo].[PlanSchedules] ps with(nolock) left join [dbo].[PlanPositions] pp with(nolock) on ps.Id = pp.[PlanScheduleId] where ps.PublishDate >= dateadd(dd, -29, convert(date, getutcdate()))"
- #zabbix_send "orders_staging" "Documents.Procesing.Staging.Delay" "SELECT avg(DATEDIFF(hour, OrderTimestamp, DocumentTimStamp)) FROM (SELECT top 100 od.Timestamp as DocumentTimStamp, o.Timestamp as OrderTimestamp FROM OrderDocuments od with (nolock) inner join Orders o with (nolock) on o.Id = od.OrderId WHERE IsProccessed = 1 and IsCurrentEdition = 1 and od.TimeStamp > o.Timestamp ORDER BY od.Id DESC) core "
- #Sphinx_staging
- sphinx_check "orders_staging" "Orders.Published.Sphinx.active" "194.58.37.40" "19316" "publishDate" "CurrentDay" "Active"
- sphinx_check "orders_staging" "Orders.Published.Sphinx.working" "194.58.37.40" "19316" "publishDate" "CurrentDay" "Working"
- sphinx_check "orders_staging" "Orders.Published.Sphinx.finished" "194.58.37.40" "19316" "publishDate" "CurrentDay" "Finished"
- sphinx_check "orders_staging" "Orders.Published.Sphinx.cancelled" "194.58.37.40" "19316" "publishDate" "CurrentDay" "Cancelled"
- sphinx_check "orders_staging" "Orders.Published.Sphinx.total.currentday" "194.58.37.40" "19316" "publishDate" "CurrentDay" "All"
- sphinx_check "orders_staging" "Orders.Published.Sphinx.total.month" "194.58.37.40" "19316" "publishDate" "Last30Days" "All"
- sphinx_check "orders_staging" "Orders.Updated.Sphinx.active" "194.58.37.40" "19316" "lastEvent" "CurrentDay" "Active"
- sphinx_check "orders_staging" "Orders.Updated.Sphinx.working" "194.58.37.40" "19316" "lastEvent" "CurrentDay" "Working"
- sphinx_check "orders_staging" "Orders.Updated.Sphinx.finished" "194.58.37.40" "19316" "lastEvent" "CurrentDay" "Finished"
- sphinx_check "orders_staging" "Orders.Updated.Sphinx.cancelled" "194.58.37.40" "19316" "lastEvent" "CurrentDay" "Cancelled"
- sphinx_check "orders_staging" "Orders.Updated.Sphinx.total.currentday" "194.58.37.40" "19316" "lastEvent" "CurrentDay" "All"
- sphinx_check "orders_staging" "Orders.Updated.Sphinx.total.month" "194.58.37.40" "19316" "lastEvent" "Last30Days" "All"
- #mssql_check "MsSQL.Status"
- zabbix_send "orders_staging" "Orders.Published.MsSQL.active" "select count(*) from Orders with(nolock) where TenderStageId = 1 and PublishDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Published.MsSQL.working" "select count(*) from Orders with(nolock) where TenderStageId = 11 and PublishDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Published.MsSQL.finished" "select count(*) from Orders with(nolock) where TenderStageId = 21 and PublishDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Published.MsSQL.cancelled" "select count(*) from Orders with(nolock) where TenderStageId = 31 and PublishDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Published.MsSQL.total.currentday" "select count(*) from Orders with(index(IX_Orders_Stage_PublishDate), nolock) where PublishDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Published.MsSQL.total.month" "select count(*) from Orders with(index(IX_Orders_Stage_PublishDate), nolock) where PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) and LawId<4"
- zabbix_send "orders_staging" "Orders.Updated.MsSQL.active" "select count(*) from Orders with(nolock) where TenderStageId = 1 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Updated.MsSQL.working" "select count(*) from Orders with(nolock) where TenderStageId = 11 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Updated.MsSQL.finished" "select count(*) from Orders with(nolock) where TenderStageId = 21 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Updated.MsSQL.cancelled" "select count(*) from Orders with(nolock) where TenderStageId = 31 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Updated.MsSQL.total.currentday" "select count(*) from Orders with(nolock) where MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- zabbix_send "orders_staging" "Orders.Updated.MsSQL.total.month" "select count(*) from Orders with(nolock) where MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())) and LawId<4"
- zabbix_send "orders_staging" "Contracts.Updated.MsSQL.month" "select count(*) from Contracts with(nolock) where [MaxEventDate] >= dateadd(dd, -29, convert(date, getutcdate()))"
- zabbix_send "orders_staging" "Contracts.Updated.MsSQL.currentday" "select count(*) from Contracts with(nolock) where [MaxEventDate] >= convert (date, getutcdate())"
- zabbix_send "orders_staging" "Contracts.Published.MsSQL.month" "select count(*) from Contracts with(nolock) where [CreateDate] >= dateadd(dd, -29, convert(date, getutcdate()))"
- zabbix_send "orders_staging" "Contracts.Published.MsSQL.currentday" "select count(*) from Contracts with(nolock) where [CreateDate] >= convert (date, getutcdate())"
- #MsSQL.Status
- #zabbix_send "orders_staging" "Orders.Published.MsSQL.Staging.total.currentday" "select count(*) from Orders with(nolock) where PublishDate >= convert (date, getutcdate()) and LawId<4"
- #MSSQL Staging
- zabbix_send "orders" "Orders.Published.MsSQL.Staging.total.month" "select count(*) from Orders with(nolock) where PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) and LawId<4"
- zabbix_send "orders" "Orders.Updated.MsSQL.Staging.total.currentday" "select count(*) from Orders with(nolock) where MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- #zabbix_send "orders_staging" "Orders.Updated.MsSQL.Staging.total.month" "select count(*) from Orders with(nolock) where MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())) and LawId<4"
- ################ SREZ STAGING
- zabbix_send "orders_staging" "Orders44.Staging.protocols.percent" "select 100.0 * sum(iif(s.Parcipiants = 0, 0, 1)) / count(s.Id) [ProtocolsPercent]
- from (
- select o.Id
- ,o.LawId
- ,(
- (select count(*) from TenderParticipants tp1 with(nolock) where tp1.OrderId = o.Id) +
- (select count(*) from TenderParticipants tp2 with(nolock) where tp2.LotId in (select Id from Lots where OrderId = o.Id))
- ) [Parcipiants]
- from Orders o with(nolock)
- inner join TenderTypes tt with(nolock) on tt.Id = o.TenderTypeId
- where o.PublishDate >= dateadd(dd, -30, convert(date, getutcdate()))
- and o.TenderStageId = 21
- and o.LawId = 3
- and tt.Name not like '%единствен%'
- ) s"
- zabbix_send "orders_staging" "Orders223.Staging.protocols.percent" "select 100.0 * sum(iif(s.Parcipiants = 0, 0, 1)) / count(s.Id) [ProtocolsPercent]
- from (
- select o.Id
- ,o.LawId
- ,(
- (select count(*) from TenderParticipants tp1 with(nolock) where tp1.OrderId = o.Id) +
- (select count(*) from TenderParticipants tp2 with(nolock) where tp2.LotId in (select Id from Lots where OrderId = o.Id))
- ) [Parcipiants]
- from Orders o with(nolock)
- inner join TenderTypes tt with(nolock) on tt.Id = o.TenderTypeId
- where o.PublishDate >= dateadd(dd, -30, convert(date, getutcdate()))
- and o.TenderStageId = 21
- and o.LawId = 2
- and tt.Name not like '%единствен%'
- ) s"
- ##############
- #zabbix_send "orders_staging" "Contracts.Updated.MsSQL.Staging.month" "select count(*) from Contracts with(nolock) where [MaxEventDate] >= dateadd(dd, -29, convert(date, getutcdate()))"
- #zabbix_send "orders_staging" "Contracts.Updated.MsSQL.Staging.currentday" "select count(*) from Contracts with(nolock) where [MaxEventDate] >= convert (date, getutcdate())"
- #zabbix_send "orders_staging" "Contracts.Published.MsSQL.Staging.month" "select count(*) from Contracts with(nolock) where [CreateDate] >= dateadd(dd, -29, convert(date, getutcdate()))"
- #zabbix_send "orders_staging" "Contracts.Published.MsSQL.Staging.currentday" "select count(*) from Contracts with(nolock) where [CreateDate] >= convert (date, getutcdate())"
- #zabbix_send "orders_staging" "Orders.Updated.MsSQL.Staging.active" "select count(*) from Orders with(nolock) where TenderStageId = 1 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- #zabbix_send "orders_staging" "Orders.Updated.MsSQL.Staging.working" "select count(*) from Orders with(nolock) where TenderStageId = 11 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- #zabbix_send "orders_staging" "Orders.Updated.MsSQL.Staging.finished" "select count(*) from Orders with(nolock) where TenderStageId = 21 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- #zabbix_send "orders_staging" "Orders.Updated.MsSQL.Staging.cancelled" "select count(*) from Orders with(nolock) where TenderStageId = 31 and MaxEventDate >= convert (date, getutcdate()) and LawId<4"
- #Pacts
- zabbix_send "orders_staging" "Orders.Pacts.Publish.Staging.CurrentDay" "SELECT COUNT(*) FROM Pacts p WITH(NOLOCK) WHERE p.IsNewVersion = 1 AND p.PublishDate >= convert (date, getutcdate())"
- zabbix_send "orders_staging" "Orders.Pacts.Sign.Staging.CurrentDay" "SELECT COUNT(*) FROM Pacts p WITH(NOLOCK) WHERE p.IsNewVersion = 1 AND p.SignDate >= convert (date, getutcdate())"
- pacts_check "orders_staging" "Orders.Pacts.Sign.Staging.Portal.CurrentDay" "sign" "CurrentDay"
- pacts_check "orders_staging" "Orders.Pacts.Publish.Staging.Portal.CurrentDay" "publish" "CurrentDay"
- # Fabrikant
- # moved to fabrikant_checker.ps fabrikant_check_double "orders_staging" "Staging.Fabrikant.Orders.ALL.Currentday" "Staging.Fabrikant.Orders.Commerce.Currentday"
- #ETPGPB
- etpgpb_check "orders" "ETPGPB.Orders.All.Currentday"
- zabbix_send "orders_staging" "ETPGPB.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [EtpProcessingDate] >= convert (date, getutcdate()) and EtpId=11 AND ExternalNumber IS NOT NULL"
- zabbix_send "orders_staging" "ETPGPB.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 11 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- zabbix_send "orders_staging" "ETPGPB.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 11 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "ETPGPB.Processed.Spinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "11"
- sphinx_check_2 "orders_staging" "ETPGPB.Processed.Spinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "11"
- #sphinx_check_2 "orders_staging" "ETPGPB.Processed.Spinx.total.month" SphinxWatcher.exe -h "194.58.37.40" -p "19316" --date "All" --period "Last30Days" --law 11
- #sphinx_check_2 "orders_staging" "ETPGPB.Processed.Spinx.total.currentday" SphinxWatcher.exe -h "194.58.37.40" -p "19316" --date "All" --period "CurrentDay" --law 11
- #ETPRF
- etprf_check_double "orders" "ETPRF.Orders.All.Currentday"
- zabbix_send "orders_staging" "Staging.ETPRF.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [EtpProcessingDate] >= convert (date, getutcdate()) and EtpId=6 AND ExternalNumber IS NOT NULL"
- #zk360-7128
- zabbix_send "orders_staging" "ETPRF.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 6 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- sphinx_check_2 "orders_staging" "ETPRF.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "6"
- zabbix_send "orders_staging" "ETPRF.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 6 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "ETPRF.Processed.Sphinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "6"
- #fabrikant
- zabbix_send "orders_staging" "Staging.Fabrikant.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [EtpProcessingDate] >= convert (date, getutcdate()) and EtpId=4 AND ExternalNumber IS NOT NULL"
- zabbix_send "orders_staging" "fabrikant.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 4 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- sphinx_check_2 "orders_staging" "fabrikant.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "4"
- zabbix_send "orders_staging" "fabrikant.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 4 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "fabrikant.Processed.Sphinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "4"
- #tender.pro
- zabbix_send "orders_staging" "TenderPro.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [EtpProcessingDate] >= convert (date, getutcdate()) and EtpId=5 AND ExternalNumber IS NOT NULL"
- # zabbix_send "orders_staging" "TenderPro.Orders.Duplicates.Currentday" "select count(*) from Orders with(nolock) where [Timestamp] >= convert(date, getutcdate()) AND LawId = 2 AND (ExternalNumber IS NOT NULL) AND ((EtpName like '%tender.pr%') OR (EtpAddress like '%tender.pr%'))"
- zabbix_send "orders_staging" "tenderpro.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 5 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- sphinx_check_2 "orders_staging" "tenderpro.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "5"
- zabbix_send "orders_staging" "tenderpro.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 5 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "tenderpro.Processed.Sphinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "5"
- #B2B
- b2b_check_double "orders" "B2B.Orders.All.Currentday" (moved to B2BWatcher.ps1)#bilo zakommentirovano
- zabbix_send "orders_staging" "B2B.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [EtpProcessingDate] >= convert (date, getutcdate()) and EtpId=7 AND ExternalNumber IS NOT NULL"
- zabbix_send "orders_staging" "b2b.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 7 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- sphinx_check_2 "orders_staging" "b2b.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "7"
- zabbix_send "orders_staging" "b2b.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 7 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "b2b.Processed.Sphinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "7"
- #AKD
- akd_check_double "orders" "AKD.Orders.All.Currentday"
- #zabbix_send "orders_staging" "AKD.Orders.Processed.Currentday" "select count(*) from orders with (nolock) where Lawid = 8 and [EtpProcessingDate] >= convert (date, getutcdate())"
- #zabbix_send "orders_staging" "AKD.Orders.Processed.Currentday" "declare @dt date = convert (date, getutcdate() - 1); select count(*) from orders with (nolock) where etpid = 8 and convert (date, [EtpProcessingDate]) >= @dt"
- zabbix_send "orders_staging" "AKD.Orders.Processed.Currentday" "select count(*) from orders with (nolock) where etpid = 8 and convert (date, [EtpProcessingDate]) = convert (date, getutcdate() - 1)"
- zabbix_send "orders_staging" "AKD.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] WHERE LawId = 8 AND (EtpProcessingDate >= convert(date, getutcdate()))"
- sphinx_check_2 "orders_staging" "AKD.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "8"
- zabbix_send "orders_staging" "AKD.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] WHERE LawId = 8 AND (EtpProcessingDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "AKD.Processed.Sphinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "8"
- #OTC
- otc_check_double "orders_staging" "OTC.Orders.All.Currentday" "OTC.Orders.Commerce.Currentday"
- #zabbix_send "orders_staging" "OTC.Orders.Processed.Currentday" "select count(*) from orders with (nolock) where Lawid = 10 and [EtpProcessingDate] >= convert (date, getutcdate())"
- zabbix_send "orders_staging" "OTC.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [EtpProcessingDate] >= convert (date, getutcdate()) and EtpId=10 AND ExternalNumber IS NOT NULL"
- zabbix_send "orders_staging" "OTC.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 10 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- sphinx_check_2 "orders_staging" "OTC.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "10"
- zabbix_send "orders_staging" "OTC.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] with(nolock) WHERE LawId = 10 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- sphinx_check_2 "orders_staging" "OTC.Processed.Sphinx.total.month" "194.58.37.40" "19316" "All" "Last30Days" "10"
- #ESTP
- #Estp.Currentday
- #Estp.Orders.All.Currentday 1 число из EstpWatcher
- #Estp.Orders.Commerce.Currentday 2 число из EstpWatcher
- #Estp.Orders.Processed.Currentday select count(*) from Orders with(nolock) where [Timestamp] >= convert (date, getutcdate()) and EtpId=9 AND ExternalNumber IS NOT NULL
- Estp_check_double "orders_staging" "Estp.Orders.All.Currentday" "Estp.Orders.Commerce.Currentday"
- zabbix_send "orders_staging" "Estp.Orders.Processed.Currentday" "select count(*) from Orders with(nolock) where [Timestamp] >= convert (date, getutcdate()) and EtpId=9 AND ExternalNumber IS NOT NULL"
- #
- #Estp.Processed.currentday
- #Estp.Processed.MsSQL.total.currentday SELECT count(*) FROM [Orders] WHERE LawId = 9 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))
- zabbix_send "orders_staging" "Estp.Processed.MsSQL.total.currentday" "SELECT count(*) FROM [Orders] WHERE LawId = 9 AND (PublishDate >= convert(date, getutcdate()) OR MaxEventDate >= convert(date, getutcdate()))"
- #Estp.Processed.Sphinx.total.currentday SphinxWatcher.exe -h "%SERVER%" -p "%PORT%" –date "All" –period "CurrentDay" –law 9
- sphinx_check_2 "orders_staging" "Estp.Processed.Sphinx.total.currentday" "194.58.37.40" "19316" "All" "CurrentDay" "9"
- #
- #Estp.Processed.month
- #Estp.Processed.MsSQL.total.month SELECT count(*) FROM [Orders] WHERE LawId = 9 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))
- zabbix_send "orders_staging" "Estp.Processed.MsSQL.total.month" "SELECT count(*) FROM [Orders] WHERE LawId = 9 AND (PublishDate >= dateadd(dd, -29, convert(date, getutcdate())) OR MaxEventDate >= dateadd(dd, -29, convert(date, getutcdate())))"
- #Estp.Processed.Sphinx.total.month SphinxWatcher.exe -h "%SERVER%" -p "%PORT%" –date "All" –period "Last30Days" –law 9
- sphinx_check_2 "orders_staging" "Estp.Processed.Sphinx.total.month" "194.58.37.40" "19316" "Last30Days" "CurrentDay" "9"
- delimmsg
- sleep 60
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement