none
health check RRS feed

  • Pregunta

  • actualmente estoy provando diferentes comando para realizar el health check, pero estos solo me han funcionado desde los controladores de dominio, cuando los intento ejecutar en el equipo cliente (Windows XP) me presenta lo siguiente

    " no se reconoce el comando interno o externo ...."

    pero este mismo comando me funciona en el DC.

    deseo conocer que debo hacer para correr el script desde un equipo cliente.

    miércoles, 19 de octubre de 2011 15:39

Respuestas

  • Hola,

    los comandos que te comentamos en el otro tema son propios del servidor y deben ser ejecutados en DCs, no pueden ser ejecutados desde maquinas cliente.

     

    Saludos


    MCITP - Server Administrator (Windows Server 2008) MCC - Microsoft Community Contributor 2011
    • Propuesto como respuesta Ismael Borche viernes, 21 de octubre de 2011 15:18
    • Marcado como respuesta Ismael Borche martes, 25 de octubre de 2011 16:18
    jueves, 20 de octubre de 2011 6:28
    Moderador

Todas las respuestas

  • Hola,

    los comandos que te comentamos en el otro tema son propios del servidor y deben ser ejecutados en DCs, no pueden ser ejecutados desde maquinas cliente.

     

    Saludos


    MCITP - Server Administrator (Windows Server 2008) MCC - Microsoft Community Contributor 2011
    • Propuesto como respuesta Ismael Borche viernes, 21 de octubre de 2011 15:18
    • Marcado como respuesta Ismael Borche martes, 25 de octubre de 2011 16:18
    jueves, 20 de octubre de 2011 6:28
    Moderador
  • Buenas tardes, te dejo un script de Health Check que te puede ser util.

    #
    #.SYNOPSIS
    #Performs a quick health check on Exchange 2010 Mailbox servers
    #
    #

    param ( [Parameter(Position=0, Mandatory=$false)] $server)

     

    #...................................
    # Initialize
    #...................................


    $ErrorActionPreference = "SilentlyContinue"
    $WarningPreference = "SilentlyContinue"

    [int]$mapitimeout = 10         #Timeout for each MAPI connectivity test, in seconds
    [int]$highqueue = 30         #Change this to set database copy/replay queue high threshold
    [int]$warnqueue = 10         #Change this to set database copy/replay queue warning threshold

    $pass = "Green"
    $warn = "Yellow"
    $fail = "Red"

    $now = [DateTime]::Now

    $dbcopystatus = @()

    #...................................
    # Functions
    #...................................

     

    #...................................
    # Script
    #...................................

    #Check if a single server was specified, or run for all mailbox servers
    if ($server -eq $null)
    {
     $mbservers = @(Get-ExchangeServer | Where {$_.IsMailboxServer -eq $true -and $_.IsE14OrLater -eq $true})
    }
    else
    {
     $mbservers = @($server)
    }

    foreach ($server in $mbservers)
    {
     Write-Host -ForegroundColor White "------ Checking" $server

     Write-Host "Ping test: " -NoNewline;
     $ping = new-object System.Net.NetworkInformation.Ping
     $result = $ping.send($server)
     
     if ($result -eq $null)
     {
      $result = "error"
     }
     else
     {
      $result = $result.status.ToString()
     }
     
     if ($result –ne "Success")
     {
      #Server is not reachable
      Write-Host -ForegroundColor $warn "Server $server is not up or not reachable by ping"
     }
     else
     {
      Write-Host -ForegroundColor $pass "Pass"
      
      #Uptime check, warn for less than 24 hours uptime
      $laststart = [System.Management.ManagementDateTimeconverter]::ToDateTime((Get-WmiObject -Class Win32_OperatingSystem -computername $server).LastBootUpTime)
      [int]$uptime = (New-TimeSpan $laststart $now).TotalHours
      [int]$uptime = "{0:N0}" -f $uptime
      Write-Host "Uptime (hrs): " -NoNewline;
      Switch ($uptime -le 23) {
       $true { Write-Host -ForegroundColor $warn $uptime }
       $false { Write-Host -ForegroundColor $pass $uptime }
       }
         
      #Verify Exchange version and roles (necessary if server was specified as an argument)
      $roles = Get-ExchangeServer $server
      
      #Catch non-Exchange servers
      if ($roles -eq $null )
      {
       Write-Host "Server $server is not an Exchange server"
      }

      #Catch non-Exchange 2010 MB servers
      if ($roles.IsMailboxServer -eq $true -and $roles.IsE14OrLater -eq $true)
      {
       #Check Service Health, has to be an array due to how multi-role servers return Test-ServiceHealth results
       $servicehealth = @(Test-ServiceHealth $server)
       
       #List service health for all roles, because this may be impacting mailbox server health
       foreach($service in $servicehealth)
       {
        Write-Host $service.Role "services: " -NoNewline;
        if ($service.requiredservicesrunning -eq $true)
        {
         Write-Host -ForegroundColor $pass "Pass"
        }
        else
        {
         Write-Host -ForegroundColor $fail "Fail"
         Write-Host $service.Role "Services not running: "
         $servicesdown = @($service.ServicesNotRunning)
         foreach ($svcdown in $servicesdown)
         {
          Write-Host -ForegroundColor $fail `t$svcdown
         }
        }
       }
       
       #Check mailbox database status
       $dbs = @(Get-MailboxDatabase -Server $server -Status | Where {$_.Recovery -ne $true})

       if ($dbs.count -gt 0)
       {
        #First check mailbox databases are mounted
        
        [string]$status = "Pass"
        $alerts = @()
        
        Write-Host "Mailbox databases mounted: " -NoNewline;
        foreach ($db in $dbs)
        {
         if ($db.mounted -ne $true)
         {
          $status = "Fail"
          $alerts += $db.name
         }
        }
        
        if ($status -eq "Pass")
        {
         Write-Host -ForegroundColor $pass $status
        }
        else
        {
         Write-Host -ForegroundColor $fail "Fail"
         Write-Host "Offline databases: "
         foreach ($al in $alerts)
         {
          Write-Host -ForegroundColor $fail `t$al
         }
        }
       
        #Now test MAPI connectivity to each database
      
        [string]$status = "Pass"
        $alerts = @()
        
        Write-Host "MAPI connectivity: " -NoNewline;
        foreach ($db in $dbs)
        {
         $mapistatus = Test-MapiConnectivity -Database $db -PerConnectionTimeout $mapitimeout
         if ($mapistatus.Result.Value -ne "Success")
         {
          $status = "Fail"
          $alerts += $db.name
         }
        }
        
        if ($status -eq "Pass")
        {
         Write-Host -ForegroundColor $pass $status
        }
        else
        {
         Write-Host -ForegroundColor $fail "Fail"
         Write-Host "MAPI failed to: "
         foreach ($al in $alerts)
         {
          Write-Host -ForegroundColor $fail `t$al
         }
        }
        
        #Check mail flow, if there are active databases on this server
        Write-Host "Mail flow test: " -NoNewline;
        $activedbs = @($dbs | Where {$_.Server -ieq $server.name})
        if ($activedbs.count -gt 0 )
        {
         $flow = Test-Mailflow $server
         if ($flow.testmailflowresult -eq "Success")
         {
          Write-Host -ForegroundColor $pass $flow.testmailflowresult
         }
         else
         {
          Write-Host -ForegroundColor $fail $flow.testmailflowresult
         }
        }
        else
        {
         Write-Host "Skip, no active mailbox databases"
        }
       }
       else
       {
        Write-Host "No mailbox databases on $server"
       }
       
       #Check public folder database status
       $dbs = @(Get-PublicFolderDatabase -server $server -status)
       if ($dbs.count -gt 0)
       {
       
        [string]$status = "Pass"
        $alerts = @()
       
        Write-Host "Public Folder databases mounted: " -NoNewline;

        foreach ($db in $dbs)
        {
         if ($db.mounted -ne $true)
         {
          $status = "Fail"
          $alerts += $db.name
         }
        }
        
        if ($status -eq "Pass")
        {
         Write-Host -ForegroundColor $pass $status
        }
        else
        {
         Write-Host -ForegroundColor $fail "Fail"
         Write-Host "Offline databases:"
         foreach ($al in $alerts)
         {
          Write-Host -ForegroundColor $fail `t$al
         }
        }
       }
         
       #Check DAG
       $IsDAG = Get-MailboxServer $server.name
       if ($IsDAG.DatabaseAvailabilityGroup -ne $null)
       {
        #Server is a member of a DAG
       }

       #Check Database Copies (this can be performed on non-DAG members too) 
       $tmpdbcopystatus = @(Get-MailboxDatabaseCopyStatus -server $server.name)
       
       [string]$status = "Pass"
       $alerts = @()
       
       
       Write-Host "Database copy status: " -NoNewline;
       foreach ($dbcopy in $tmpdbcopystatus)
       {
        #Filter out RDBs
        $rdbcheck = Get-MailboxDatabase -identity $dbcopy.databasename
        if ($rdbcheck.Recovery -ne $true )
        {
         $dbcopystatus += $dbcopy
        }
       }
       
       foreach ($dbcopy in $dbcopystatus)
       {
        
        #Check each database copy status

        if (!($dbcopy.status -eq "Healthy" -or $dbcopy.status -eq "Mounted"))
        {
         $status = "Fail"
         $alerts += $dbcopy.name
        }
       }

       
       if ($status -eq "Pass")
       {
        Write-Host -ForegroundColor $pass $status
       }
       else
       {
        Write-Host -ForegroundColor $fail "Fail"
        Write-Host "Unhealthy databases:"
        foreach ($al in $alerts)
        {
         Write-Host -ForegroundColor $fail `t$al
        }
       }
       
       #Check copy/replay queues (this can be performed on non-DAG members too)

       Write-Host "Database copy/replay queue (total): " -NoNewline;
       [int]$copyqueue = ($dbcopystatus | Measure-Object CopyQueueLength -Sum).sum
       [int]$replayqueue = ($dbcopystatus | Measure-Object ReplayQueueLength -Sum).sum
       [int]$totalqueue = $copyqueue + $replayqueue
       
       if ($totalqueue -le $warnqueue)
       {
        Write-Host -ForegroundColor $pass $totalqueue
       }
       elseif ($totalqueue -gt $warnqueue -and $totalqueue -lt $highqueue)
       {
        Write-Host -ForegroundColor $warn $totalqueue
       }
       else
       {
        Write-Host -ForegroundColor $fail $totalqueue
       }
       
         
       #Check content indexes

       [string]$status = "Pass"
       $alerts = @()
       
       Write-Host "Database content index state: " -NoNewline;
       foreach ($dbcopy in $dbcopystatus)
       {
        #Check each database content index
        if (!($dbcopy.ContentIndexState -eq "Healthy"))
        {
         $status = "Fail"
         $alerts += $dbcopy.name
        }
       }
        
       if ($status -eq "Pass")
       {
        Write-Host -ForegroundColor $pass $status
       }
       else
       {
        Write-Host -ForegroundColor $fail "Fail"
        Write-Host "Unhealthy indexes:"
        foreach ($al in $alerts)
        {
         Write-Host -ForegroundColor $fail `t$al
        }
       }
      }
      else
      {
       Write-Host "Server $server is not an Exchange 2010 mailbox server."
      }
     }
    }

    Saludos!!!


    Gaston A. Gimené - MCP(MCTS) MCTS: Microsoft Certified Technology Specialist

    • Propuesto como respuesta Gaston Gimené lunes, 21 de enero de 2013 12:57
    miércoles, 2 de enero de 2013 18:40