Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 16th, 2009, 03:19 AM
gingerbeast121 gingerbeast121 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 1 gingerbeast121 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 55 sec
Reputation Power: 0
DOS Batch - How to send a warning email following a Dell openmanage event

Hi all,

I am still very new to scripting and I have been tasked with creating a script that sends an email following an Dell openmanage event (processor failure, temperature warning etc etc etc). So far the company already has a set of scripts to do this. However, they want all those scripts (and there is one for each event) streamlined and collated into just one script that does everything. Is there a way to do this is a batch file? Maybe through the event viewer and task scheduler. I am working with server 2008. I have included 3 of the individual scripts below if you guys would like to take a look. :-)

Code:
@ECHO OFF

SET OPENMANAGEALERT=Temperature Warning

FOR /F %%A IN ('TYPE "D:\OpenManage-Alerts\hostname.ini"') DO (SET SUBJECT_HOSTNAME=%%A)

FOR /F %%B IN ('TYPE "D:\OpenManage-Alerts\smtp-server.ini"') DO (SET BMAIL_SERVER=%%B)
FOR /F %%C IN ('TYPE "D:\OpenManage-Alerts\smtp-port.ini"') DO (SET BMAIL_PORT=%%C)
FOR /F %%D IN ('TYPE "D:\OpenManage-Alerts\to.ini"') DO (SET BMAIL_TO=%%D)
FOR /F %%E IN ('TYPE "D:\OpenManage-Alerts\from.ini"') DO (SET BMAIL_FROM=%%E)

SET BMAIL_SUBJECT="[OpenManage] %SUBJECT_HOSTNAME% %OPENMANAGEALERT%"

D:\OpenManage-Alerts\bmail.exe -s %BMAIL_SERVER% -p %BMAIL_PORT% -t %BMAIL_TO% -f %BMAIL_FROM% -h -a %BMAIL_SUBJECT%



Code:
@ECHO OFF

SET OPENMANAGEALERT=Processor Warning

FOR /F %%A IN ('TYPE "D:\OpenManage-Alerts\hostname.ini"') DO (SET SUBJECT_HOSTNAME=%%A)

FOR /F %%B IN ('TYPE "D:\OpenManage-Alerts\smtp-server.ini"') DO (SET BMAIL_SERVER=%%B)
FOR /F %%C IN ('TYPE "D:\OpenManage-Alerts\smtp-port.ini"') DO (SET BMAIL_PORT=%%C)
FOR /F %%D IN ('TYPE "D:\OpenManage-Alerts\to.ini"') DO (SET BMAIL_TO=%%D)
FOR /F %%E IN ('TYPE "D:\OpenManage-Alerts\from.ini"') DO (SET BMAIL_FROM=%%E)

SET BMAIL_SUBJECT="[OpenManage] %SUBJECT_HOSTNAME% %OPENMANAGEALERT%"

D:\OpenManage-Alerts\bmail.exe -s %BMAIL_SERVER% -p %BMAIL_PORT% -t %BMAIL_TO% -f %BMAIL_FROM% -h -a %BMAIL_SUBJECT%



Code:
@ECHO OFF

SET OPENMANAGEALERT=System Power Failure

FOR /F %%A IN ('TYPE "D:\OpenManage-Alerts\hostname.ini"') DO (SET SUBJECT_HOSTNAME=%%A)

FOR /F %%B IN ('TYPE "D:\OpenManage-Alerts\smtp-server.ini"') DO (SET BMAIL_SERVER=%%B)
FOR /F %%C IN ('TYPE "D:\OpenManage-Alerts\smtp-port.ini"') DO (SET BMAIL_PORT=%%C)
FOR /F %%D IN ('TYPE "D:\OpenManage-Alerts\to.ini"') DO (SET BMAIL_TO=%%D)
FOR /F %%E IN ('TYPE "D:\OpenManage-Alerts\from.ini"') DO (SET BMAIL_FROM=%%E)

SET BMAIL_SUBJECT="[OpenManage] %SUBJECT_HOSTNAME% %OPENMANAGEALERT%"

D:\OpenManage-Alerts\bmail.exe -s %BMAIL_SERVER% -p %BMAIL_PORT% -t %BMAIL_TO% -f %BMAIL_FROM% -h -a %BMAIL_SUBJECT%


So far I am using bmail to send out an email on a per event basis (in the Dell openmanage server administrator each error event opens a specific batch file). I cant wrap my head around how to incorprate all this into one script though as surely the file paths in the Dell openmanage administrator would simply run the entire batch file and send out every single error message even if the only problems was that the temperature was too high

I would be eternally grateful for any input into this and I apologise if it seems like a noobish question but, like I said, I am very new to scripting

Thanks a lot

Dave

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > DOS Batch - How to send a warning email following a Dell openmanage event


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek