Number of hosts per rule Script

Hello

By following http://en.community.dell.com/techcenter/performance-monitoring/foglight-administrators/f/4788/t/19550391, we have a good wee script that returns the names of all the enabled rules that the scope is a certain crowd against.  The original script on this page has been changed, here's the actual script that we use:

Don't forget to change the hostname down!

//

Initialize

//

def rs = server ["RuleService"]

def QS = server ["QueryService"]

def rules = rs.getAllRules)

def hosts = new TreeMap()

Browse all rules

//

(rule of rules)

{

This will not work for the rules without a scope query, so

Let's ignore them!

//

def query = rule.getScopingQuery)

isRunning def = rule.isRunning)

If (request == null | query == "" |! isRunning)

continue

Kickoff of the scope query and see what we get.

Browse all topology objects

and collect the monitored hosts.

//

def objs = qs.queryTopologyObjects (query)

for (obj in objs)

{

host of def = obj ['monitoredHost']

If we cannot find the monitored host, this rule

probably does not apply to us

//

if(Host == null)

continue

Create a new location for this host if necessary

//

def hostName = host ["name"]

def hostRules = host [hostname]

if(hostRules == null)

{

hostRules = [] like TreeSet

host [hostname] = hostRules

}

Add the rule to the host

//

hostRules.add (rule.getName ())

}

}

Print pretty

//

guests return ["your - client.here.com'"]

Example of output would be:

[CPU use, system files, use memory capacity]

This script can be edited (or a written new) for a particular rule, it will return a list of all the hosts extended?  I guess it's pretty simple for geniuses here.

Thank you

Brian

Hi Brian...

I have an iteration over for you. This gets all the rules and runs

application of determination of the scope of each rule. It takes each result of said and tries to find any host (s) Hung

out some likely properties of the result (see the getRelatedHostName() method). You can

grep through the results for the rules you are interested in.

Enjoy!

Robert

def rs = server ["RuleService"]

def QS = server ["QueryService"]

def rules = rs.getAllRules)

def rulesMap = new TreeMap()

def tryPath (source, path) {}

result = null

try {}

result = source.get (path)

}

catch (Exception e) {}

Returns the result

}

def getRelatedHostName (objectID) {}

def hostname = null

def source = null

try {}

source = server. TopologyService.getObject (objectID)

}

catch (Exception e) {}

e return

}

If (source! = null) {}

host name = tryPath (source, ' monitoredHost/name "" ")

If (hostname == null) {}

host name = tryPath (source, "the name of the controller/monitoredHost /")

}

If (hostname == null) {}

name of host = tryPath (source, 'parent, agent, monitoredHost, name')

}

If (hostname == null) {}

host name = tryPath (source, ' / hostname ")

}

If (hostname == null) {}

host name = tryPath (source, ' controller / / hostname ")

}

If (hostname == null) {}

name of host = tryPath (source, "agent/hostName")

}

If (hostname == null) {}

parents-tryPath (source, 'parents')

If (parent! = null & parents.size () > 0) hostName = tryPath (parents [0], "/ hostname")

}

If (hostname == null) {}

parents-tryPath (source, ' controller/parents')

If (parent! = null & parents.size () > 0) hostName = tryPath (parents [0], "/ hostname")

}

}

Returns the host name

}

for (rule rules) {}

This will not work for the rules without a scope query, so

Let's ignore them!

//

def query = rule.getScopingQuery)

If (request == null | query == "")

continue

def objs = qs.queryTopologyObjects (query)

for (obj in objs) {}

relatedHostName = getRelatedHostName (obj.uniqueId);

If (relatedHostName is nothing)

continue

ruleName = rule ['name'] def;

def hostRules = rulesMap [ruleName];

if(hostRules == null) {}

hostRules = [] like TreeSet

rulesMap [ruleName] = hostRules

}

hostRules.add (relatedHostName);

}

}

Print pretty

//

def sb = new StringBuilder()

(entry in {rulesMap.entrySet ())}

SB. Append (entry. Key)

SB. Append ("\n")

SB. Append (entry.value.join(","))

SB. Append ("\n\n")

}

sb.toString)

Tags: Dell Tech

Similar Questions

  • Number of hosts per cluster limit VMFS

    I can't find a decent answer to this question.  In versions, earlier we are limited to 8 hosts per cluster when using VMFS data with view warehouses.  All this changed with the advent of vSphere 5.5 or 6 view Horizon?  Looking at a bunch of documentation, I see that in vSphere specifications 5.1, it says "32 hosts (VMFS + NFS).  However, in the specifications of vSphere 5.5, he States '32 hosts', with not the Tag-Along "VMFS + NFS".

    Someone at - there no hard document about this?

    Thank you!

    Check out this link.  http://myvirtualcloud.NET/?p=4432

  • Number of hosts per LUN

    Hello world

    I've never really thought about it until I started going through some of the design books that are out there.

    This is all based on what I read in here.

    It is recommended to stick to a dozen or so hosts per cluster and you should connect to not more than 8 guests in a single LUN.

    If I follow this guideline, which is good practices about which 8 hosts, I decide to connect to a given LUN?

    What the DRS/HA in a cluster like this? DRS and HA is smart enough to understand that some a host does not have access to a certain LUN

    and choose another host, or would it fail?

    This question has a meaning?

    See you soon

    Hello

    The clarion should have no problem, but the MSA2000 may have some. I didn't a lot of research on this subject. The easiest way would be to add hosts to LUN until the SCSI reservation conflicts arise... This will give the upper limit.

    Best regards

    Edward L. Haletky

    VMware communities user moderator

    ====

    Author of the book "VMWare ESX Server in the enterprise: planning and securing virtualization servers, Copyright 2008 Pearson Education.»

    Blue gears and SearchVMware Pro Articles: http://www.astroarch.com/wiki/index.php/Blog_Roll

    Security Virtualization top of page links: http://www.astroarch.com/wiki/index.php/Top_Virtualization_Security_Links

  • Number of hosts per AP

    Hello

    you want to know AP1230s how much I needed to take charge 150 customers in a large conference room.  Until someone started on me, these are the only available APs.    Customers will be a mix of the laptops using a variety of different adapters.

    Thanks in advance!  All the answers have been evaluated.

    Between 4 and 6 APs.

  • See the number of paths per LUN by host

    Hello

    I saw so many scripts these days on how to check my connections of storage, but I still don't get the info for that I'm looking. I'd like to see for each host for each LUN (RDM / Datastore) the number of paths. I found scripts that show me the active paths, paths of deaths and work, but none of them helps me to see the number of paths for each host.

    The following Luke good script seems to be a good starting point, but again once it shows total by hba, that I need for each host per lun.

    $esx = get-VMHost vcdvm580.virtualcenter.lan

    foreach ($hba to (VMHostHba Get - VMHost $esx - type "FibreChannel")) {}

    $target = ((get - see $hba. VMhost). Config.StorageDevice.ScsiTopology.Adapter | where {$_.} Adapter - eq $hba. Key}). Goal

    $luns = get-ScsiLun - Hba $hba - LunType 'disk '.

    $nrPaths = ($target | % {$_.}) Lun.Count} | Measure - Object - sum). Sum

    Write-Host $hba. Device ' target: ' $target. County "devices:" $luns. County ' path: ' $nrPaths

    }

    Any help would be appreciated.

    Gabrié

    You mean something like this?

    $esxName = "MyEsx".

    $esx = get-VMHost-name $esxName

    $esxcli = get-EsxCli - VMHost $esxName

    $hba = get-VMHostHba - VMHost $esx - type FibreChannel | Select the name of ExpandProperty-

    $esxcli.storage.core.path.list () |

    Where {$hba - contains $_.} Adapter} |

    Group-object - property feature |

    Select @{N = "MON"; E={$_. Name}},@{N='#path'; E={$_. Group.Count}}

  • Number of records per column in each table

    Hi all

    I need to get the number of records by column for each table in a schema.

    Is there a way I get the list of columns in each table in a schema and get the number of records per column where the count > 0?

    We have oracle 10g

    Thank you

    Smidreb wrote:
    You are right, but we're going to run the script as soon as we move

    the script below gives me a correct result.

    If it works well for you, then it works OK for me.

    Realize that Oracle is that I/O block-level.
    As a general rule, any LINE is a single block.
    Realize that is 1 column "count (*)" is correct, then all the columns in the same row are correct.
    This obsessive compulsion to count each COLUMN in each LINE borders on real PARANOIA!

  • PowerCLI - get the number of cores per processor and number of Sockets

    Greetings,

    We are responsible to give a list of all our virtual machines with their host name, the number of CPUs, the BONES and the number of cores per processor for verification.

    I immediately said that this would not be a problem with PowerCLI. However I seem to have more trouble with it than expected.

    Get the number of CPUS is not a problem, but the time wherever I want to divide the number of cores and the number of sockets, it seems to hit a dead end.

    I found the following entries of the community concerned:

    Re: vSphere 5. Casings of vCPU and cores per CPU (PowerCLI) bug

    Machine virtual access avancΘs | VMware vSphere Blog - VMware Blogs

    Parameters to retrieve and set Advanced Configuration (VMX) VM

    But neither seemed to give me the right input. The advanced configuration settings do not appear to contain the number of cores/sockets and Get-View and Get - VM normal controls do not seem to differentiate between carrots and the power outlets and just give the number of processors.

    Because we need these settings for a check I doubt I'm the first to need this information. Does anyone have an idea how to get this information?

    Please note that it is the number of cores and casings of a VM, not an ESXi host.

    Thanks in advance,

    Bram

    $result = @)
    $vms = get - view - ViewType VirtualMachine
    {foreach ($vm to $vms)
        $obj = new-object psobject
        $obj | Add-Member - MemberType NoteProperty-name name - value $vm. Name
        $obj | Add-Member - MemberType NoteProperty - name CPUSocket-$vm.config.hardware.NumCPU value
        $obj | Add-Member - MemberType NoteProperty - name Corepersocket-$vm.config.hardware.NumCoresPerSocket value
        $result += $obj
      
    }
    $result
  • MAX hosts per Pool of resources?

    Hello

    Looking ate Lele Maximums of Configuration doc for vSphere4 Update1, I can't find information like the number MAX of ESXi hosts perresource pool.

    Ask because we just added 8 ESXi hosts in the default pool and our broker began broadcasting the following error message:

    Event type: WARNING

    Event source: VMware View

    Event category: VMware View

    Event ID: 104

    Date: 12/07/2010

    Time: 15:10:25

    User: NT AUTHORITY\SYSTEM

    Computer: CDEVBROKER01

    Description:

    Pool cn = 3cf943ec-9879-45dc-92b5-c8fbe919b1c8, OU = virtualcenter, OU = propriΘtΘs, dc = vdi, dc is vmware, dc = int::Unable to create the new VM - VMware.Sim.Fault.TooManyHostsInComputeResourceFault: pool of resources me = resgroup-152, cluster me = field-c7, numHosts = 15, maxHosts = 8

    Then within the administration Web page VIEW data warehouses were more visible, non of them!  We then removed the new 8 hosts and now everything is fine. So my question is:

    Is this a limitation of resource pool or the host of MAX 8 for the limitation of the view?

    The limitation is around composer, and you can have a maximum of 8 hosts per cluster

    http://www.VMware.com/PDF/view40_admin_guide.PDF

  • Limit the maximum number of characters per line in the TextField, help please

    Hello Livecycle designers!

    It would be great if you could help me with the following problem. I have a TextField with 5 lines (limit of the viewable area and the exact height) and I want to limit the maximum number of characters per line up to 10 (as well as the total in this field at 50, but I'm able to do with the option "time limit, max characters").

    As far as I know can be done only by the script so if you change that I wrote:

    lines of the var = xfa.event.newText.toString().split('\n');

    i = Lines.Length,
    maxChar = "10";

    If {(maxChar)
    While (I--> 0) {}
    If (rows [i] .length == maxChar) {}
    XFA. Event.change = "\n";
    }
    }
    }

    and actually who works very well when instead of '\n' in the 1st line, I put any character (e.g. ' |' and I won't pretend that ' |' is my new \n).

    So the main problem is to split the text entered by the user in lines (the '\n' is unfortunately not working). So the solution to this problem would somehow split my Textbox in lines (in table) after the user presses ENTER.

    I'd appreciate any help here, so if you have just 2 minutes of your time, please help me.

    Hello

    I have rebuild your idea... that is the result.

    var Input = xfa.event.fullText;

    var FullLength = Input.length;

    var SplitLength = 10

    var SplitParts = Math.ceil(FullLength / SplitLength)

    var JoinString = "";

     

    for (var i = 0; i)<= splitparts;="">

    {

    SplitString = Input.substring (0, SplitLength);

    Entry = Input.replace (SplitString, "");

    JoinString = JoinString + SplitString + "\u000a";

    }

    xfa.resolveNode("Textfield2").rawValue = JoinString;

  • samples per channel and the number of samples per channel

    in my DAQ mode samples finished program, there are two screws: timing and read.vi DAQmx DAQmx.

    I have to set the parameter to "samples per channel" DAQmx timing.vi and 'number of samples per channel' on DAQmx read.vi... Is there a relationship between these two?

    My laser runs at 1 K Hz. I want to go to the wavelength, wait for a number of shooting lasers, read the data and move on to the next page...

    Thank you

    Lei

    In your case, the VI will acquire the lesser of either:

    The "samples per channel" that you have defined on the timing DAQmx VI

    -OR-

    The number of iterations of your for loop (N) times the 'number of samples per channel"that you have defined on the DAQmx read VI

    The "samples per Channel" VI DAQmx of timing for a finite acquisition dictates how many samples the DAQ hardware should acquire in it's onboard buffer before indicating that the acquisition is complete.  "The number of samples per Channel" on the read DAQmx VI dictates how many samples the DAQmx driver must return buffer on board the aircraft to your application.

    Let's say the "samples per channel" on the calendar DAQmx VI is set to 50.  Thus, the card will acquire 50 samples and place them in the edge of the buffer, then stops.  Suppose we have the 'number of samples per Channel"on the DAQmx reading VI the value 3 and what we call the VI in a loop For which runs 10 times.  Thus, every time the DAQmx lu VI is called, it will wait until there are at least 3 samples in the buffer, and then return these three.  We call the VI a total of 10 times, then we will answer 30 total samples.  Thus, the last 20 samples acquired the card remains in the buffer and are destroyed when the task is disabled.

    Now let's say that we increase the "number of samples per Channel" on our DAQmx Read VI at 10.  VI Read will wait until 10 or more samples are in the buffer, and then return these 10. Thus, we will be back all 50 samples map acquired by the 5th iteration of the loop For.  The 6th time we call him VI DAQmx Read it expires, because there will never be another 10 samples in the buffer, and the VI returns a warning.

    This clarifies things?

    The purpose of this behavior is to allow you to both set the total number of samples that the DAQ hardware will acquire and also control how much of these samples is returned whenever you call the DAQmx Read VI.

    Kind regards

  • How to abort Continuous Acquisition (which is set to acquire a constant number of samples per channel each iteration)?

    Hi all

    I would like to continuously acquire an input channel analog and, if necessary, be able to stop the acquisition as quickly as possible.

    I use a card NI USB-6289. I implemented a DAQmx (voltage) analog input task, set the clock sampling DAQmx 'continuous samples' and the rate required (IE 1000, which is 1 kHz). For the acquisition, I used a while loop with inside the DAQmx Read with Terminal 'number of samples per channel', wired (IE 1000). The while loop waits until 1000 samples are acquired and therefore continuously reads the channel in uniform batches of 1000 samples every second ticking. The while loop can be easily interrupted when the DAQmx has completed the acquisition of the lot being 1000 samples, but it takes the DAQmx finish their current task.

    My problem is how to stop the loop while the DAQmx Read lies in the middle to get 1000 samples WITHOUT delay all 1000 samples are received? Is it possible to interrupt the DAQmx Read?

    I could reduce "the number of samples per second", increasing the responsiveness of the while loop, but this is not the solution I prefer. I tried to destroy the task (outside the while loop), but that does not stop immediately the acquisition, Read DAQmx still finish acquire 1000 samples. I've included an example Subvi. When I was using a PCI card, I used a timed while loop with inside the DAQmx Read with Terminal 'number of samples per channel' wired-1 (= which means ' read everything in the buffer "). In this case, it was easy to stop the acquisition at any time: the timed, while the loop is abandoned and the acquisition has ceased immediately. But it does not work with an NI USB-6289 map (see thread http://forums.ni.com/ni/board/message?board.id=170&message.id=386509&query.id=438879#M386509) because of the different way the data are transferred to the PC.

    Thank you very much for your help!

    Have a great day,

    LucaQ

    Hi LucaQ,

    Your solutions are decrease of the number of samples, or record the time you want to stop and remove samples that have been acquired beyond this time. There is no other way to stop the actual reading out of the hardware store.

    Flash

  • What is an effective way to way logarithmic bin data with a constant number of points per decade?

    Hi all

    I would like to clean a logarithmic field of PSD in binning and averaging so that I have a constant number of points per decade (say 10, just for the sake of argument). Generally, means simpler and cleaner, I can think about getting this is research in the table entering all points between the frequencies A and B, with an average of these points and assigning a frequency (A + B) / 2 of the new average bin. However, I cannot find how to access frequency information, I need to achieve this. To be more clear, I can imagine if I had two tables, one who holds the frequencies calculated from my stream of incoming data, and the other which held and the amplitude of each corresponding frequency, that I might look for clues in the frequency table with values between A and B, then the average of the values in the table of amplitude which lie between the indices back put them in a new table with a new array of corresponding frequency. The process is a little more general that just on average every ten points, to say, as the number of points per decade continues to grow. My main obstacle at the moment, however, is that the amplitudes of the voltage are a set of values that receive through the operation of PSD, while the part of the frequency of the wave seems to be a DBL continues single-valued. I hope I've explained that well enough for someone to shed some light on my problem. Also, if anyone has a suggestion for a better way to approach the problem please let me know - there must be a pretty simple answer there, but it's deceiving me right now. Thanks in advance for the help.

    -Alex

    Hello

    If I get you right. you have:

    a table with the frequencies

    a table with the corresponding values of amplitude

    Then you want to merge parts of the data by averaging on the specific frequency ranges. I think that there is no VI 1 solution, you will need to write this on your own ():

    I start to get the min/max of frequencies and then interpolate a scale from your needs (like logarythmic) mounting with the quantity of bins you want. This should be an array again.

    Next step is to browse the frequency table, check (the first and) the last value in the location wanted (stop the loop, return the index). This should end up with an array of index. [I guess that's where you can save some computation time most by smart]

    Finally, use these indices to browse the amplitude values and make your average. Should return an array of the length of your array of locations.

    Ground in color fantasies and enjoy.

    Just what you intend to do?

  • Bouba Analyzer: How to control the number of points per decade?

    Total newbie here. I can't control the number of points per decade in the Bode VI. It's always 5 points per decade.

    Don't know even how to get the Version of Elvis #, but it is at a minimum 4.1, because Elvis installer will install 4.1 (said the current version is most recent). Running Windows XP.

    How can I get Elvis to respond to my request for more points per decade?

    Mike

    Hi Mike,.

    If you are still curious about what drivers you have installed, you can view by using the Measurement & Automation Explorer (start"all programs" National Instruments"Measurement & Automation Explorer).  "Once their, go to my system" software and you'll find NI ELVISmx and its version.

    This behavior you're seeing is a known, class problem under Corrective Action Request (CAR) #373017.  For now, the number of points per decade will remain at 5.  Please wait for the next update of NOR-ELVISmx to see if this problem is fixed.

    See you soon,.

  • Total number of samples per channel

    Hello

    I was wondering if you can call a function that returns the total number of samples per channel read. I try to get a precise timestamp.

    I use DAQmx ANSI C developer environment.

    According to NOR:

    Option #1:

    Try and do exactly what the driver is doing.  This will require you to do exactly what you do in the displayed example.  Call time current system immediately before calling the DAQmx Read and subtract dt * x where x is the number of samples already acquired.  It will take you to know exactly how many samples were acquired.  It can be found by calling the Total property of the samples by chain acquired immediately before the DAQmx Read.  This is to introduce some points for innaccuracy.  For example, you're time system is already innaccurate to a certain amount.  In addition, it takes some time between the system times call, calling the total number of samples acquired and calling the DAQmx reading.  If 2 samples are acquired between the call to the time system and the total number of samples acquired, you could be shifted a few samples.  For the slower clock rates, you will have more precision.

    I try to attempet to program this solution, but cannot find the total number of samples per channel acquired property. If anyone can help me, your help will be very appreciated.

    Thank you for your help,

    Vladimir

    Hi Vladimir,.

    Here is the property you are looking for (as the C reference help):

    You will be able to get accurate relative timestamps, since we know that our acquisition is based on a sample with a certain dt clock.  The value of initial time must still come from the OS.

    Best regards

    John

  • I need to improve the performance of a Web site and I want to track the total number of requests per second...

    I need to improve the performance of a Web site and I want to track the total number of requests per second... we are currently hitting...

    Please I need to hit the current with 1200 queries/second application, please help in this regard.

    Hi Nivask,

    If you created the Web site, the question would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums for assistance:

    Internet Explorer Web development

Maybe you are looking for

  • Problem between IOS 10 &amp; Notes

    Goodmorning, I'm updating the iPhone 6 + and I have a problem with the Notes application. The application of close Notes after a few seconds. 10 IOS is not reliable at the moment. No idea how I can fix this problem? Thank you.

  • Satellite M70-340 - cannot install new windows

    Hello world. I had the problem in my laptop. DVD-RAM (mast * one device dvd ram uj - 841 s ata) not work and now I have problem to install new windows on my system! The my laptop do not support USB boot, I can't install USB also.I want to know how I

  • Forgotten my security questions.

    I forgot my security questions and therefore can't edit or change them how do I do this. Thank you

  • Several files in a temp folder cannot be deleted, rename, copy, or move to XP

    I have several files in my temp folder that I can't delete, rename, copy, or move. I was hunting for them with research and it brings back me to the same temp file. The registry can not find them. I even tried to delete using BACK, but it says no fil

  • How can I fix my webcam?

    OK, so I'm having this very annoying problem with my webcam that's happened for a long time. I have a Toshiba laptop with Windows 7, in case that helps any. It's blurred, I see nothing and I can't also use MSN, Skype and even take pictures. Help, ple