1 2 Previous Next 26 Replies Latest reply on Jun 25, 2020 2:08 AM by LucD Go to original post
      • 15. Re: Export All Alarms and definitions from VCenter.
        RJ4719 Novice

        LucD,

        Have three new vCenters 2- are production and 1 is more for QA and test.

        All alarms are set to default however need some guidance on setting them up quickly.

        I really like this idea: http://www.cloudyfuture.net/2017/08/08/powercli-script-configure-vcenter-alarm-email/

        However few flaws:

        1. IT would seem from the comments it overwrites the subject field of the email to recipients.

        2. Feel he also has an issue in 6.7 vcsa with multiple recipients in the TO as the ; and , is an issue.

        3. Doesn't really provide for a way to copy EXACTLY what is there today and re-import if needed, meaning you need to set back to a default date.

        4. He doesn't have a most recent copy of alarms for 6.7 U2c

        5. When I look at avail alerts like my "CPU Exhaustion on psc-mydatacenter01-0001" I dont see this is his list, and worried what it will do if it finds or does not find it.

         

        Really just looking for a way to get up and running quickly in 6.7 vcenter with alarms sent to two or more recipients, and dont want to loose the default if an issue.

         

        In the end it would also be nice to either perform the same action on both Production vCenters (keep in sync) then alter the emails sent from the non-prod vCenter.- meaning i dont want to send from here as no one really cares about Dev/QA env.

         

        Have you seen anything avail like he referenced script above that will really do the job in 6.7u2c vCenter?

        • 16. Re: Export All Alarms and definitions from VCenter.
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors

          Interesting idea, and yes, what you envisage should be possible.

          May I suggest opening a new thread for this, since the concept goes way beyond the original question in this thread.

          And it would make it easier for others to find it,

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 17. Re: Export All Alarms and definitions from VCenter.
            sanjaygpt171 Novice

            HI LuCD,

            I tried to excute this script and it'sworking but in output file , i am geting multiple duplicate values. Could you please fix this.

            Below is the same output:

            Alarm Description Enabled

            Host connection and power state Default alarm to monitor host connection and power state TRUE

            Host connection and power state Default alarm to monitor host connection and power state TRUE

            Host connection and power state Default alarm to monitor host connection and power state TRUE

            Host connection and power state Default alarm to monitor host connection and power state TRUE

            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE

            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE

            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE

            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE

            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE

            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE

            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE

            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE

             
            Alarm Description Enabled
            Host connection and power state Default alarm to monitor host connection and power state TRUE
            Host connection and power state Default alarm to monitor host connection and power state TRUE
            Host connection and power state Default alarm to monitor host connection and power state TRUE
            Host connection and power state Default alarm to monitor host connection and power state TRUE
            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE
            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE
            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE
            vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE
            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE
            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE
            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE
            vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE
            • 18. Re: Export All Alarms and definitions from VCenter.
              LucD Guru
              User ModeratorsCommunity WarriorsvExpert

              The same alarm might be defined on multiple entities.
              I would need to see the Entity column to see if these are actually duplicates or not.

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 19. Re:Solved: Export All Alarms and definitions from VCenter.
                sanjaygpt171 Novice
                Alarm Description Enabled Last Modified Last Modified By Entity
                Host connection and power state Default alarm to monitor host connection and power state TRUE 11/6/2015 7:18 Datacenters
                Host connection and power state Default alarm to monitor host connection and power state TRUE 11/6/2015 7:18 Datacenters
                Host connection and power state Default alarm to monitor host connection and power state TRUE 11/6/2015 7:18 Datacenters
                Host connection and power state Default alarm to monitor host connection and power state TRUE 11/6/2015 7:18 Datacenters
                vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Hosts with connectivity issues' Default alarm to monitor changes for the health test 'Hosts with connectivity issues' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                vSAN health alarm 'Data health' Default alarm to monitor changes for the health group test 'Data health' TRUE 11/6/2015 7:20 com.vmware.vsan.health Datacenters
                • 20. Re:Solved: Export All Alarms and definitions from VCenter.
                  LucD Guru
                  Community WarriorsUser ModeratorsvExpert

                  You are sure that you don't have multiple connections to the vSphere Server open?

                  What is in $global:defaultviservers?

                   

                  Do you see the same alarm multiple times in the Web Client?

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  • 21. Re: Export All Alarms and definitions from VCenter.
                    sanjaygpt171 Novice

                    I am trying to reply on thread but getting error "Portlet is temporarily unavailable." After multiple attempts , i got to post my comments.

                    Hi LuCD,
                    I executed the command "$global:defaultviservers" in my powercli and it's listing only single vcenter against which i am executing the script.

                    Even, i checked in my web client and i am seeing alarm defined only once . I tried to run on different vcenter but was getting same multiple duplicate rows 

                    • 22. Re: Export All Alarms and definitions from VCenter.
                      LucD Guru
                      Community WarriorsUser ModeratorsvExpert

                      Try changing the last line to

                       

                      } | Sort-Object -Property Alarm,Entity -Unique |

                      Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture

                      Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                      • 23. Re: Export All Alarms and definitions from VCenter.
                        sanjaygpt171 Novice

                        Hi Lucd,

                         

                        Duplicate alarms are filtered out but in my vcenter i can see 206 alarms but in report only 72 is exported. I am not sure , why i am seeing such huge difference

                         

                         

                        • 24. Re: Export All Alarms and definitions from VCenter.
                          LucD Guru
                          vExpertUser ModeratorsCommunity Warriors

                          I just realised why you see duplicates (without the Sort-Object), there is an entry per Alarm for each status change: green->yellow, yellow->red, red->yellow, yellow->green
                          That was the original request in this thread

                          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                          • 25. Re: Export All Alarms and definitions from VCenter.
                            sanjaygpt171 Novice

                            I have removed the below line from the script but it's exporting less number of alarms . I can see 221 alarms in my vcenter but script is pulling only 72 alarms. I am not sure why i am seeing such huge difference. I have checked the vcenter alarms and there are no duplicates alarms. My biggest concern is about less number of alarms.

                             

                            @{N='Expression';E={

                             

                             

                                            ($alarm.ExtensionData.Info.Expression.Expression |

                             

                             

                                            ForEach-Object -Process {"{0} ({1}) - {2} - {3}" -f $_.EventType,

                             

                             

                                                                                                $_.EventTypeId,

                             

                             

                                                                                                $_.ObjectType,

                             

                             

                                                                                                ([VMware.Vim.ManagedEntityStatus]$_.Status.value__)}) -join '|'

                             

                             

                                        }},

                             

                             

                                        @{N='Trigger';E={

                             

                             

                                            "{0}:{1}->{2} (Repeat={3})" -f $action.ActionType,

                             

                             

                                                                           $_.StartStatus,

                             

                             

                                                                           $_.EndStatus,

                             

                             

                                                                           $_.Repeat

                             

                             

                                        }}#>

                            • 26. Re: Export All Alarms and definitions from VCenter.
                              LucD Guru
                              User ModeratorsCommunity WarriorsvExpert

                              That is not enough.
                              The script also looks at the alarm trigger(s).

                              If there are none, the alarm will not appear in the output.

                               

                              See your other thread for a basic version of reporting on alarms.

                              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                              1 2 Previous Next