Recent Discussions
API v3 Python Patch on user 403 forbidden
I have some old python code (that I didnt write) that uses v1 of the API that does a patch with a super minimal patch data block, just the value needed. Personally, I have Groovy code that does some patching using the retrieved user in a Map object and I make a minimal map with just the stuff v3 requires that I set (which v1 didnt) like roles and password and etc, and I managed to get code working with Groovy v3. But I'm in a circumstance where I have to use python and patch on a user, and for the life of me, I keep getting a 403 forbidden error. I've found several examples online, and basically I believe I've got everything set up correctly, the code is mostly similar to the old working v1 code except it has the changes that v3 needs. But I get a 403 error (forbidden). But I know the API token has rights to update the user (tho it is still attached to a user with an administrator role, but I dont think thats the issue, I have groovy code using the same API token). I hate to ask people to look at code but is there anything obviously wrong here that I'm missing for python and v3? http_verb ='PATCH'; resource_path = '/setting/admins/' + str(user_id); patch_data = '{"roles":[{"name":"myrole"}],"email":"what@whatever.what","username":"blah","password":"meh","apionly": true}'; queryParam = '?changePassword=false&validationOnly=false' url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resource_path + queryParam; epoch = str(int(time.time() * 1000)); requestVars = http_verb + epoch + patch_data + resource_path; hmac1 = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest(); signature = base64.b64encode(hmac1.encode()); auth = 'LMv1 ' + AccessId + ':' + signature.decode() + ':' + epoch; headers = {'Content-Type':'application/json','Authorization':auth,'X-Version': '3'} response_patch = lm_session.patch(url, data=patch_data, headers=headers) return response_patch; Thanks!SolvedLewis_Beard13 days agoExpert34Views0likes2CommentsResource Tree Deprecation?
I missed the latest the recent virtual Roadmap Roadshow. When reviewing the summary notes from the session, I noticed the following statement regarding the resource tree. ResourceExplorer: Say goodbye to the traditional resource tree! Our new Resource Explorer is designed for modern environments like Cloud and Kubernetes. It leverages metadata and tagging to help you quickly find and visualize resources. I don't see how resource explorer can provide feature parity when it comes to filtering, setting custom/inherited properties, grouping devices, API query refinement etc. If we lose this functionality, the product loses half it's value. Is there anyone in the community that sat in for this session that can provide some more context?SolvedDrelo20 days agoNeophyte52Views0likes3CommentsModule Toolbox z-index issue
z-index fix needed for the "Module Toolbox" page. See screenshotSolvedDavid_Bond2 months agoProfessor113Views4likes8CommentsResource Dead parameter
Hi All, I can't find an answer to this, but I am after what triggers a resource to be marked as dead (has skull icon next to resource in resource tree) I thought it was host status, but I changed the threshold from 300 to 1500 and the resource still get marked as dead after 5 minutes. The testing issue I have is that I have an escalation chain to email me at 3 minutes, sms me at 5 mintues and to call me after 7 minutes for the Ping module (1 minute polls). I get the email and sms but the phone call never comes as I believe when the resource is marked dead (at 5 minutes) any further alerting stops. Thanks in advanceSolvedbetan2 months agoNeophyte51Views2likes1CommentReporting on sqlStatusCode in SQL Server Connection Status MSSQLSERVER
Hello, all! I'm a bit new to reporting on LM and am trying to wrap my head around it. I'm trying to make a report on the sql server uptime status from SQL Server Connection Status > MSSQLSERVER. My end goal is to display the percentage of uptime over the past 24 hours, using whatever graph is necessary. I was directed to report on the sqlStatusCode, but that's not necessarily a rule set in stone. Whenever I look into the Raw Data tab, I see a table that has everything I could possibly want on it. However, whenever I try to report using any Widget other than a Custom Graph Widget, it only reports on the most recent event in the Raw Data table. Is there a way to report on the whole table? Or is it possible to export this data? It seems easy in my head: just get a count of every row where sqlStatusCode = 0, then divide that by the total number of rows and multiply by 100. Is it possible to do this?Solvedemetzler2 months agoNeophyte28Views0likes2CommentsPropertySource best practices auto vs custom
I looked at our portal and the Exchange for PropertySource modules that might have a lot of the "universal" snmp OIDs because we want to pull some in for all snmp devices. Specifically sysLocation (.1.3.6.1.2.1.1.6.0) for starters. I didn't see one so I plan to make my own. But if there is some Official PropertySource I should know about, but overlooked, let me know. But, assuming I'll be making my own, what would be the best practices for a near-universal PropertySource (isDevice() and hasCategory("snmp"))? Should it be a custom property or an auto property? aka mycompany.sysLocation vs auto.mycompany.sysLocation ? On the one hand, I think custom is made for such purposes, but given that I intend to make it "universal" and given that lots of teams use custom properties however they want (so it isnt as tidy a section as it could be) my gut level desire is to make it an auto property because I know that nobody else can set that on the portal but me, so I can guarantee some consistency. Thoughts? And thank you!Solved46Views2likes2CommentsEmail Alerting
Hi All, Is there any way we can supress the email Alerts i am getting he same email alerting every time the Alert rule runs i want only one email when the Alert is triggered and no email till the aler is cleared. I have created 3 stages is stage 1 & stage 3 as blank and stage 2 has email ID's to which the alert to be sent.Solvedvenkat2 months agoNeophyte74Views8likes4CommentsLogSource Resource Mapping Confusion
I have a ticket opened but hoping to get a quicker response here. I am using LogSources but since we are an MSP with multiple clients, there seems to be an issue syslog's are being mapped to other client devices that have the same IP because I'm using IP=system.hostname as the mapping. I have even pointed all the duplicate IPs to their respective syslog collector and it still maps wrong. Am I doing something wrong or is the system not smart enough to know that it came on this collector, therefore I should only map it to resources monitored by that collector? Is there a way I can use AND logic with the Token mapping for _lm.collectorId = system.collectorid? Thanks in advance.SolvedJustin_Lanoue2 months agoNeophyte69Views8likes7CommentsaddDevice API
Hi, I have used the above API and I can successfully add the device to LM, however I am unable to add it to a specific device group chain. I used <host_group_ids= '15,14,54',> in the body and I get the below error. HTTP response body: {"errorMessage":"Unable to add the host into an auto group, appliesTo=isMisc()","errorCode":1500,"errorDetail":null} Pease can you help me with what property needs to be populated to achieve what I need. Thankyou.Solvedcvl2 months agoNeophyte82Views2likes11Comments