Mike Moniz

Members
  • Content Count

    85
  • Joined

  • Last visited

  • Days Won

    12

Community Reputation

16 Good

1 Follower

About Mike Moniz

  • Rank
    Community All Star

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mike Moniz

    API params

    try: $resourcePath = "/device/devices" $queryParam = "?size=1000&filter=preferredCollectorId:`"$($collector.id)`"" I don't think CollectorId is a valid property for devices and APIv2 docs say to use double quotes with filters.
  2. Mike Moniz

    Multiple Collectors

    Yeah, it depends far more on what you are monitoring per device then the number of devices you have. Monitoring all the shares on a windows file server via WMI will put more load then doing SNMP on a switch. I personally don't have a lot of experience in balancing collectors myself and Auto-Balanced Collector Groups (ABCG) are very new and I haven't played with them. I would likely setting up 1 (or 2 for failover) in an auto-balanced group per site and then grow with more collectors as needed. But as I haven't used ABCG perhaps others on the forums can make better suggestions or you can open a chat with LM to look at your particular environment, especially about choosing small/med/large.
  3. Mike Moniz

    Multiple Collectors

    There are several reasons why you would want multiple collectors in an environment: High Availability: If a collector system fails you can have another one take it over (LM supports active-active). Also useful for collector upgrades without downtime Load: Depending on how many items (not just devices) your monitoring, you may need many collectors to handle the load. Site: Some site-to-site VPN are not stable enough for monitoring remotely over and there can be a major side-effect mentioned below. Network Segmentation: The collector and it's failover collectors needs to be able to directly communicate with each resource being monitored, so network segmentation may require multiple collectors. (Guess that also depends on your definition of "environment"). I don't think it really matter if you setup a virtual machine or use physical boxes. I think that would depend on your infrastructure. Most of ours are virtual without problems. A big possible problem to keep in mind about remote monitoring is due to LM's current lack of full dependencies. If a site that goes down that is being monitored by a remote collector will cause an alert for every resource at that site. Without the collector also going down, it will not cause a Collector Down condition and will not prevent the those alerts from occurring. So I avoid doing remote monitoring (on the Resource tab) whenever possible personally.
  4. Mike Moniz

    API - Posting widget updates via powershell

    The multipart boundary stuff is more related to sending large amount of data like XML file contents while most API calls including widget updates just need to pass direct JSON content. You might want to look at the examples at https://www.logicmonitor.com/support/rest-api-developers-guide/v1/rest-api-v1-examples/#Example-PowerShell-GET which uses JSON content. I also think that JSON always starts and ends with "{" or "}" so you might need to add that to your $data string. Also since you are using PowerShell, you can use ConvertTo-JSON to convert PSObjects to JSON if that makes it easier to build and modify.
  5. Mike Moniz

    Rest API Cloning Dashboards

    Not to speak for Joe but I know in my environment and as an MSP we have a template dashboard group that contains our standard templates we deploy when adding a new customer to LogicMonitor. These templates heavily use dashboard group tokens to customize it per customer. I scripted most of the complete onboarding process except for this dashboard group cloning. I actually pause the script and instruct the user to clone the group, then the script would continue and modify group tokens. At the time it looked too complex to attempt to script the cloning vs saving time of a few clicks to clone. The UI seems to have access to a /dashboard/groups/#/asyncclone?recursive=true method that is not available in the API. Something available like this would be very useful for us at least. Cloning individual dashboards would also be useful.
  6. Mike Moniz

    Complex Boolean operators on alert conditions

    Sure, then I would remove the threshold on daystoexpire and let that be for information/graphing use. Then create a complex DataPoint with the expression of "daystoexpire" which has the valid range and thresholds for alerting.
  7. Mike Moniz

    Complex Boolean operators on alert conditions

    My previous answer assumed OR conditions (if hit thresholdA OR thresholdB). If you want to do a AND like condition, which as I re-read the question, might be what you are asking, that may depend on the situation. Here I'm assuming you want to basically consider any Certs that have daystoexpire < -100 to just be ignored in all cases, in other words anything under -100 is invalid. So you can edit the "Valid value range" for daystoexpire to be "-100 to blank". That way you will just get a NaN if it's less then -100, and still have an easily changed main thresholds of < 30.
  8. Mike Moniz

    Complex Boolean operators on alert conditions

    I'm all for more complex conditions for thresholds! But as a nice workaround you can have multiple DataPoints that just report the same value but have different thresholds. For example you have have the normal daystoexpire to be > -100, and create a Complex DataPoint called "daystoexpireSoon" that has the Expression of "daystoexpire" (aka, use the same value) and set it's threshold of <300. And you can keep doing that for all the various thresholds. P.S. You can also remove the threshold for daystoexpire and create daystoexpireOld along with daystoexpireSoon, that do have thresholds, so it's clearer what each means.
  9. Mike Moniz

    API - Alerts - Filter by location

    Yep, you're correct. monitorObjectGroups field is: "Information about the groups the object is a member of" as a JSON object, per about-the-alerts-resource. Try $filters ='?filter=monitorObjectGroups~myspecificlocation' I'm actually not sure if it's possible to filter within the JSON object itself (like using .id) in the call itself.
  10. Mike Moniz

    API - Alerts - Filter by location

    How are you filtering alerts by location on the portal exactly?
  11. Mike Moniz

    Can we upgrade logic monitor collector with out downtime

    If you setup some redundancy in your monitoring infrastructure you can. For example you can have two collectors (even temporarily), failover devices between them while upgrading the other.
  12. That kinda sounds like dynamic thresholds which LM has a blog post about: https://www.logicmonitor.com/blog/dynamic-thresholds-the-new-old-buzzword/ They kinda disagree on monitoring in that way it seems. :) You can use the delta thresholds to compare the previous value and the latest value which I assume was the equivalent to your prev() and last(). But not look at data going back further. If you really need to look at more to setup your thresholds, then I would just write the DataSource to independently store that data yourself rather than attempt to extract past data from LM. For example you can write a file to the collector that stores the values for the past hour. You are already getting the data directly from the device, it would be much easier to store the data in a log/cache file instead of calling various LM APIs. I would still like to get a better specific idea of what you are attempting to implement, it might help. What device are you attempting to monitor? What DataSource(s) are you using?
  13. I generally don't like to have LM DataSources attempt to communicate back to LM itself, I personally find it a bit hacky and avoid it unless there isn't another solution. That said I do have some DataSources that do exactly this. In this case I think that would be way overkill and I would not suggest it, if you are just looking to have a bit more complex thresholds in LogicMonitor. Try looking at Complex DataPoints rather then have a DataSources that attempts to re-process it's own data. I'm not familiar with Zabbix but based on the expression you provided and references to last() and prev() I assume you my need to play with delta thresholds (section 2) in LM. Can you provide more details on what DataSource your using and what the Zabbix expression is attempting to do? A bit of a bigger picture view is needed as I think a whole different method would work better here than re-processing data. A trick you can might be able to use is to have multiple DataPoints that just return the same value, but you can setup different thresholds for each. For example if you have a Temperature DataPoint and you want to have a threshold of < 0 and > 30, you have have two DataPoints "CurrentTemp_Low" with a threshold of <0 and "CurrentTemp_High" with a threshold of >30, but both DataPoints return the same current temp value. You can implement the same thing using Complex DataPoints but doing it this way you don't need to hard code your thresholds in DataSources globally. In general I personally suggest using groovy for DataSources as it's supported with both Linux and Windows collectors built-in. But I would use PowerShell if I know it's only for Windows collectors and something it has better support for, like checking O365 or Exchange. I'm not sure you can use python or other languages in DataSources, or you would atleast need to install those langueses on all your collectors. There is a section of the LM APIv1 docs with different language examples at https://www.logicmonitor.com/support/rest-api-developers-guide/v1/rest-api-v1-examples, you will also find various examples in the community and on Mike Suding's Blog (this is a great resource). LM seems to be more of Mac shop to me so they seem use prefer python for scripts that run outside of LM. I'm more of a PowerShell guy myself but as it's all REST calls you can use any language you are comfortable with.
  14. Mike Moniz

    SDT - API issue

    Based on the error message "No such Website" I would verify that serviceId 119 is valid and the correct id of an individual website check and not a website group or resource.
  15. I did a quick test with a dummy DataSource. I let it create a dummy instance and setup a custom threshold at the group level's Alert Turning tab. I then modified the DS to have no instances and the entry disappeared from the list. I modified the DS once again to report a different instance and the entry came back and kept the previously set threshold. So it does seem to keep your custom settings even if there are no instances. I only tested the difference over a few minutes so you may want to test over a larger period of time (overnight/days). I also don't like how this causes possible hidden settings we might not be aware of. It might show up in a report though (didn't test). Interesting that the API does show it.