Feb
09

Get Your VMware View Health Check Sent To Your Inbox

This isn’t the most complicated script in the world but I like having it sent to me on Sunday night so I avoid any surprises come Monday morning. Like anything else posted on the World Wide Web, test prior to using.

I want to keep adding more useful information and strip away some of the not so useful stuff. All in time. If you have any ideas post away.

true dat
The script

$from = “vi-alerts@domain.com”
$to = “savingyourbacon@domain.com”
$subject =”VMware View Environment”
$smtpServer =”EmailServer”
$body = “Read the Attachment, Its for your own Health”
$file = “c:\\ViewHealhReport.txt”

Get-Monitor | Out-File $file

$mailer = new-object Net.Mail.SMTPclient($smtpServer)
$msg = new-object Net.Mail.MailMessage($from, $to, $subject, $body)
$attachFile = new-object Net.Mail.Attachment($file)
$msg.attachments.add($attachFile)
$mailer.send($msg)

The Output

fullName : DomainMonitor.server-IVDM1
domains : { domain={ domainName=domainname, dns=domainname.ca, state=ERROR, trusttype=TWOWAYFOREST, contactable=cANNOTBIND, isNT4=false }, otherdomain={ domainName=otherdomainname, dns=otherdomain.ca, state=OK, trusttype=TWOWAYFOREST,contactable=FULLYACCESSIBLE, isNT4=false }}
isProblem : true
netbiosName : server-IVDM1
monitor : DomainMonitor
monitor_id : server-IVDM1

fullName : VCMonitor.e7fc0383-91af-4bef-8243-9a70aabdab50
id : e7fc0383-91af-4bef-8243-9a70aabdab50
state : OK
version : 4.1.0
apiVersion : 4.1
URL : https://pnrha-lmh-mgt.pnrha.hin.sk.ca:443/sdk
isComposerEnabled : true
brokerEntry : { brokerNetbiosName=Pserver-IVDM1 , status=STATUS_UP, statusDescription=Connected }
statusInfo : { infoEntry=OK }
monitor : VCMonitor
monitor_id : e7fc0383-91af-4bef-8243-9a70aabdab50

fullName : DBMonitor.EVENTS_DATABASE
Connected : true
ServerType : SQLSERVER
Server : sql.domain.ca\virtual
Port : 1433
DbName : view_events
Username : sa
TablePrefix : ev
State : CONNECTED
Error :
ConnectedNode : CN=server-IVDM1 ,OU=Server,OU=Properties
monitor : DBMonitor
monitor_id : EVENTS_DATABASE

fullName : CBMonitor.server-IVDM1
id : server-IVDM1
isAlive : true
statusValues : { status=OK }
totalSessions : 419
totalSessionsHigh : 628
totalSVISessions : 271
totalSVISessionsHigh : 584
totalCheckedOutVms : 10
totalCheckedOutVmsHigh : 0
version : 4.5.0
build : 4.5.0 build-293049
clusterId : unknown
dns : server-IVDM1.domain.ca
netbiosName : server-IVDM1
ip : 172.11.64.33
monitor : CBMonitor
monitor_id : server-IVDM1

More VMware View scripting at Virtual-Al

NOTE: View Powershell commands can only be ran from the view connection server.

Speak Your Mind

*