SlideShare a Scribd company logo
1 of 16
Azure AppFabric Service Busでクラウド型PC監視サービスを作ってみる 26 August 2010 #jazug 中原 知也@tnkhr01
自己紹介 中原 知也 (Twitter :   @tnkhr01) 新しいモノに目がない Azure歴1年(2009CTP~) 本職は仮想化系営業/SE/ソリューション開発 社内でAzureの話があがると駆けつける人 Tech・Days 2010 でAzure賞を頂きました-> 26-Aug-10 @tnkhr01 2
クラウド型PC監視サービス? Agent 監視対象PC (Agent起動) 26-Aug-10 @tnkhr01 3 Internet Explorer Tool 監視用PC
Windows Azure クラウド型PC監視サービス? Windows Azure Platform AppFabricService Bus End Point Web Role WCF WCF WCF Agent Tool Internet Explorer 監視対象PC (Agent起動) 監視用PC 26-Aug-10 @tnkhr01 4
AppFabric SDK V1.0EchoSample 今回はコレを ベースに 実装してみる Windows Azure Platform AppFabric Service Bus EndPoint Echo:「Hello Azure!」 Service.exe Client.exe http://www.microsoft.com/downloads/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5 26-Aug-10 @tnkhr01 5 Return:「Hello Azure!」
クラウド(Service Bus)側の実装 26-Aug-10 @tnkhr01 6
Service(監視Agent)側の実装 <実装方法>  受け取ったEchoをコマンドと見立てて実行し、 標準出力をクライアントに返す(だけ)。 <メリット>  楽。 <デメリット>  セキュリティ的に激しく危険。  (実際は構文解析+フィルタが必須)  public string Echo(string text)  { ProcessStartInfopsi = new ProcessStartInfo(); psi.FileName = System.Environment. GetEnvironmentVariable("ComSpec"); psi.RedirectStandardInput= false; psi.RedirectStandardOutput = true; psi.UseShellExecute= false; psi.CreateNoWindow = true; psi.Arguments= @"/c " + text;         Process p = Process.Start(psi);         string results = p.StandardOutput.ReadToEnd(); p.WaitForExit();         return results; } 26-Aug-10 @tnkhr01 7
Client(監視用Tool)側の実装 <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) 26-Aug-10 @tnkhr01 8
26-Aug-10 @tnkhr01 9 typeperf-sc 1 "rocessor(*) Processor Time” "(PDH-CSV 4.0)","E4300-02rocessor(0) Processor Time","E4300-02rocessor(1) Processor Time","E4300-02rocessor(_Total) Processor Time" "08/25/2010 00:36:54.941","7.964674","31.363486","19.664075"                コマンドは、正しく完了しました。 Client(監視用Tool)側の実装 CPU使用率 (コア1,2,合計) <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) sc query state= all … SERVICE_NAME: W3SVC DISPLAY_NAME: World Wide Web Publishing Service         TYPE               : 20  WIN32_SHARE_PROCESS         STATE              : 4  RUNNING                                 (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)         WIN32_EXIT_CODE    : 0  (0x0)         SERVICE_EXIT_CODE  : 0  (0x0)         CHECKPOINT         : 0x0         WAIT_HINT          : 0x0 SERVICE_NAME: WAS … プロセス稼働状況 …と表示してほしいが?
ハマりました 大きなデータを送受信すると… Error: 操作 'Echo' の応答メッセージの本文をシリアル化解除しているときにエラーが発生しました。XML データの読み取り中に、最大文字列コンテンツ長のクォータ (8192)を超えました。このクォータを増やすには、XML リーダーの作成時に使用される XmlDictionaryReaderQuotasオブジェクトの MaxStringContentLengthプロパティを変更してください。 26-Aug-10 @tnkhr01 10
Client/Program.cs (問題の箇所) // create the channel factory loading the configuration ChannelFactory<IEchoChannel> channelFactory =  newChannelFactory<IEchoChannel>  ("RelayEndpoint", newEndpointAddress(serviceUri)); // apply the Service Bus credentials channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential); // create and open the client channel IEchoChannelchannel = channelFactory.CreateChannel(); channel.Open(); … 26-Aug-10 @tnkhr01 11
Client/App.config (bindingの確認)  <client>       <!-- Application Endpoint -->       <endpoint name="RelayEndpoint“	contract="Microsoft.ServiceBus.Samples.IEchoContract“	binding="netTcpRelayBinding"/>     </client> 26-Aug-10 @tnkhr01 12
Client/Program.cs (変更後) // create the channel factory loading the configuration NetTcpRelayBinding binding = new NetTcpRelayBinding(); binding.Name = "RelayEndpoint"; binding.MaxReceivedMessageSize = 819200; binding.MaxBufferSize = 819200; binding.ReaderQuotas.MaxStringContentLength = 819200; binding.ReaderQuotas.MaxNameTableCharCount = 819200; ChannelFactory<IEchoChannel> channelFactory =  newChannelFactory<IEchoChannel>  	(binding, new EndpointAddress(serviceUri)); // apply the Service Bus credentials … 「msdnセキュリティに関するデータの考慮事項」は要確認 http://msdn.microsoft.com/ja-jp/library/ms733135.aspx 26-Aug-10 @tnkhr01 13
DEMO 26-Aug-10 @tnkhr01 14 Windows Azure Windows Azure Platform AppFabricService Bus End Point Web Role WCF PC電源入れたまま 外出してしまった! スリープに! WCF Agent ブラウザ 監視対象Win7 PC (Agent起動) ガラケー @tnkhr01
まとめ 26-Aug-10 @tnkhr01 15
26-Aug-10 @tnkhr01 16

More Related Content

Viewers also liked

Creando vms con azure power shell
Creando vms con azure power shellCreando vms con azure power shell
Creando vms con azure power shellVíctor Moreno
 
Sql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & IkeSql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & IkeIke Ellis
 
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...Evilázaro Alves
 
SQL Azure Federation and Scalability
SQL Azure Federation and ScalabilitySQL Azure Federation and Scalability
SQL Azure Federation and ScalabilityEduardo Castro
 
Building An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureBuilding An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureEric Nelson
 
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...Microsoft Private Cloud
 
Scaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure FederationsScaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure FederationsMichael Rys
 
Migrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows AzureMigrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows AzureBrian Bendera
 
Bases de datos SQL Azure en Microsoft Azure con C#
Bases de datos SQL Azure en Microsoft Azure con C#Bases de datos SQL Azure en Microsoft Azure con C#
Bases de datos SQL Azure en Microsoft Azure con C#Víctor Moreno
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Jason L Brugger
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersMichael Rys
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQLMichael Rys
 
Azure Data Lake Intro (SQLBits 2016)
Azure Data Lake Intro (SQLBits 2016)Azure Data Lake Intro (SQLBits 2016)
Azure Data Lake Intro (SQLBits 2016)Michael Rys
 

Viewers also liked (13)

Creando vms con azure power shell
Creando vms con azure power shellCreando vms con azure power shell
Creando vms con azure power shell
 
Sql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & IkeSql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & Ike
 
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
Entendendo Microsoft Application Server: Windows Server AppFabric, WF, WCF, W...
 
SQL Azure Federation and Scalability
SQL Azure Federation and ScalabilitySQL Azure Federation and Scalability
SQL Azure Federation and Scalability
 
Building An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureBuilding An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql Azure
 
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
Microsoft Windows Azure - Platfrom Appfabric Service Bus And Access Control P...
 
Scaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure FederationsScaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure Federations
 
Migrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows AzureMigrating Data-Centric Applications to Windows Azure
Migrating Data-Centric Applications to Windows Azure
 
Bases de datos SQL Azure en Microsoft Azure con C#
Bases de datos SQL Azure en Microsoft Azure con C#Bases de datos SQL Azure en Microsoft Azure con C#
Bases de datos SQL Azure en Microsoft Azure con C#
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for Developers
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQL
 
Azure Data Lake Intro (SQLBits 2016)
Azure Data Lake Intro (SQLBits 2016)Azure Data Lake Intro (SQLBits 2016)
Azure Data Lake Intro (SQLBits 2016)
 

Recently uploaded

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Azure AppFabric Service Bus でクラウド型PC監視サービスを作ってみる

  • 1. Azure AppFabric Service Busでクラウド型PC監視サービスを作ってみる 26 August 2010 #jazug 中原 知也@tnkhr01
  • 2. 自己紹介 中原 知也 (Twitter :   @tnkhr01) 新しいモノに目がない Azure歴1年(2009CTP~) 本職は仮想化系営業/SE/ソリューション開発 社内でAzureの話があがると駆けつける人 Tech・Days 2010 でAzure賞を頂きました-> 26-Aug-10 @tnkhr01 2
  • 3. クラウド型PC監視サービス? Agent 監視対象PC (Agent起動) 26-Aug-10 @tnkhr01 3 Internet Explorer Tool 監視用PC
  • 4. Windows Azure クラウド型PC監視サービス? Windows Azure Platform AppFabricService Bus End Point Web Role WCF WCF WCF Agent Tool Internet Explorer 監視対象PC (Agent起動) 監視用PC 26-Aug-10 @tnkhr01 4
  • 5. AppFabric SDK V1.0EchoSample 今回はコレを ベースに 実装してみる Windows Azure Platform AppFabric Service Bus EndPoint Echo:「Hello Azure!」 Service.exe Client.exe http://www.microsoft.com/downloads/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5 26-Aug-10 @tnkhr01 5 Return:「Hello Azure!」
  • 7. Service(監視Agent)側の実装 <実装方法>  受け取ったEchoをコマンドと見立てて実行し、 標準出力をクライアントに返す(だけ)。 <メリット>  楽。 <デメリット>  セキュリティ的に激しく危険。  (実際は構文解析+フィルタが必須) public string Echo(string text) { ProcessStartInfopsi = new ProcessStartInfo(); psi.FileName = System.Environment. GetEnvironmentVariable("ComSpec"); psi.RedirectStandardInput= false; psi.RedirectStandardOutput = true; psi.UseShellExecute= false; psi.CreateNoWindow = true; psi.Arguments= @"/c " + text; Process p = Process.Start(psi); string results = p.StandardOutput.ReadToEnd(); p.WaitForExit(); return results; } 26-Aug-10 @tnkhr01 7
  • 8. Client(監視用Tool)側の実装 <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) 26-Aug-10 @tnkhr01 8
  • 9. 26-Aug-10 @tnkhr01 9 typeperf-sc 1 "rocessor(*) Processor Time” "(PDH-CSV 4.0)","E4300-02rocessor(0) Processor Time","E4300-02rocessor(1) Processor Time","E4300-02rocessor(_Total) Processor Time" "08/25/2010 00:36:54.941","7.964674","31.363486","19.664075"                コマンドは、正しく完了しました。 Client(監視用Tool)側の実装 CPU使用率 (コア1,2,合計) <実装方法>  コマンドをEchoとして監視Agentに送り込み、  標準出力を受け取って整形・表示する。 <メリット>  標準出力のままでよければコード変更の必要なし (…?) <デメリット>  HTML化(テーブル表現等)は手間。  作りこむとOS Version依存など。  (PowerShell、WMI+WSHなどうまく使いたいところ) sc query state= all … SERVICE_NAME: W3SVC DISPLAY_NAME: World Wide Web Publishing Service TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 SERVICE_NAME: WAS … プロセス稼働状況 …と表示してほしいが?
  • 10. ハマりました 大きなデータを送受信すると… Error: 操作 'Echo' の応答メッセージの本文をシリアル化解除しているときにエラーが発生しました。XML データの読み取り中に、最大文字列コンテンツ長のクォータ (8192)を超えました。このクォータを増やすには、XML リーダーの作成時に使用される XmlDictionaryReaderQuotasオブジェクトの MaxStringContentLengthプロパティを変更してください。 26-Aug-10 @tnkhr01 10
  • 11. Client/Program.cs (問題の箇所) // create the channel factory loading the configuration ChannelFactory<IEchoChannel> channelFactory = newChannelFactory<IEchoChannel> ("RelayEndpoint", newEndpointAddress(serviceUri)); // apply the Service Bus credentials channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential); // create and open the client channel IEchoChannelchannel = channelFactory.CreateChannel(); channel.Open(); … 26-Aug-10 @tnkhr01 11
  • 12. Client/App.config (bindingの確認) <client> <!-- Application Endpoint --> <endpoint name="RelayEndpoint“ contract="Microsoft.ServiceBus.Samples.IEchoContract“ binding="netTcpRelayBinding"/> </client> 26-Aug-10 @tnkhr01 12
  • 13. Client/Program.cs (変更後) // create the channel factory loading the configuration NetTcpRelayBinding binding = new NetTcpRelayBinding(); binding.Name = "RelayEndpoint"; binding.MaxReceivedMessageSize = 819200; binding.MaxBufferSize = 819200; binding.ReaderQuotas.MaxStringContentLength = 819200; binding.ReaderQuotas.MaxNameTableCharCount = 819200; ChannelFactory<IEchoChannel> channelFactory = newChannelFactory<IEchoChannel> (binding, new EndpointAddress(serviceUri)); // apply the Service Bus credentials … 「msdnセキュリティに関するデータの考慮事項」は要確認 http://msdn.microsoft.com/ja-jp/library/ms733135.aspx 26-Aug-10 @tnkhr01 13
  • 14. DEMO 26-Aug-10 @tnkhr01 14 Windows Azure Windows Azure Platform AppFabricService Bus End Point Web Role WCF PC電源入れたまま 外出してしまった! スリープに! WCF Agent ブラウザ 監視対象Win7 PC (Agent起動) ガラケー @tnkhr01