Source: Monitor remote server Windows services through SSIS and send mail Alerts!
with SSIS, you can not only do the ETL of BI project, but also do some system monitoring and maintenance work, because the Windows service written by the vendor is processed by the message of reading the ESB, and integrates with the guest system through OA process, whether it is the ESB condition, or Windows services, will have a serious impact on the access system, resulting in internal staff can not be external personnel, so the overall optimization of the ESB, in my blog's previous article has described the "Monitoring remote server disk space through SSIS and send mail alarm!" 》。 The method of implementation of this article is the same, only to monitor the status of Windows service is running, if not the status of the automatic sending of mail to alarm, for automated operation is mainly through specialized service procedures for monitoring and operation, and so on next time to introduce.
It is easy to query the remote server's Windows service information through WMI, as follows:
Connection Manager for WMI:
Define 8 package variables to monitor 8 Windows services, such as:
The WQL statements through WMI, such as:
The main implementation of the Script task is to remove the space character of the service state variable, such as:
dts.variables["Visit"]. Value = dts.variables["Visit"]. Value.tostring (). Trim (); = (int) scriptresults.success;
If the guest Windows service is not running, send an alert message such as:
This blog for the Software Life original, welcome reprint, reprint please indicate source: http://www.cnblogs.com/nbpowerboy/p/3371484.html. Deductive or for commercial purposes, but must retain the attribution software of this article life (including links). If you have any questions or authorization to negotiate, please leave me a message. |
Monitor remote server Windows services through SSIS and send mail Alerts!