Tanvir

Members
  • Content Count

    23
  • Joined

  • Last visited

Everything posted by Tanvir

  1. Is there anyone know how I can monitor this appliance in LM. Show following information in LM for monitoring <features> <feature name="McAfee" time_remaining="102892200" /> <feature name="External Threat Feeds" time_remaining="102892200" /> <feature name="Sophos" time_remaining="102892200" /> <feature name="File Analysis" time_remaining="102892200" /> <feature name="Bounce Verification" time_remaining="2712117032" /> <feature name="Cloud Administration" time_remaining="2712117032" /> <feature name="IronPort Anti-Spam" time_remaining="102892200" /> <feature name="IronPort Email Encryption" time_remaining="102892200" /> <feature name="Data Loss Prevention" time_remaining="102892200" /> <feature name="Intelligent Multi-Scan" time_remaining="102892200" /> <feature name="File Reputation" time_remaining="102892200" /> <feature name="Incoming Mail Handling" time_remaining="2712287735" /> <feature name="Graymail Safe Unsubscription" time_remaining="102892200" /> <feature name="Outbreak Filters" time_remaining="102892200" /> </features> <counters> <counter name="inj_msgs" reset="734118" uptime="734118" lifetime="734118" /> <counter name="inj_recips" reset="734965" uptime="734965" lifetime="734965" /> <counter name="gen_bounce_recips" reset="298748" uptime="298748" lifetime="298748" /> <counter name="rejected_recips" reset="5087" uptime="5055" lifetime="5087" /> <counter name="dropped_msgs" reset="48" uptime="48" lifetime="48" /> <counter name="soft_bounced_evts" reset="143030" uptime="143030" lifetime="143030" /> <counter name="completed_recips" reset="734896" uptime="734896" lifetime="734896" /> <counter name="hard_bounced_recips" reset="495144" uptime="495144" lifetime="495144" /> <counter name="dns_hard_bounced_recips" reset="6" uptime="6" lifetime="6" /> <counter name="5xx_hard_bounced_recips" reset="495118" uptime="495118" lifetime="495118" /> <counter name="filter_hard_bounced_recips" reset="0" uptime="0" lifetime="0" /> <counter name="expired_hard_bounced_recips" reset="20" uptime="20" lifetime="20" /> <counter name="other_hard_bounced_recips" reset="0" uptime="0" lifetime="0" /> <counter name="delivered_recips" reset="239751" uptime="239751" lifetime="239751" /> <counter name="deleted_recips" reset="1" uptime="1" lifetime="1" /> <counter name="global_unsub_hits" reset="0" uptime="0" lifetime="0" /> </counters> <current_ids message_id="734968" injection_conn_id="442587" delivery_conn_id="73052" /> <rates> <rate name="inj_msgs" last_1_min="0" last_5_min="0" last_15_min="4" /> <rate name="inj_recips" last_1_min="0" last_5_min="0" last_15_min="4" /> <rate name="soft_bounced_evts" last_1_min="0" last_5_min="0" last_15_min="0" /> <rate name="completed_recips" last_1_min="0" last_5_min="0" last_15_min="4" /> <rate name="hard_bounced_recips" last_1_min="0" last_5_min="0" last_15_min="0" /> <rate name="delivered_recips" last_1_min="0" last_5_min="0" last_15_min="4" /> </rates> <gauges> <gauge name="ram_utilization" current="2" /> <gauge name="total_utilization" current="28" /> <gauge name="cpu_utilization" current="9" /> <gauge name="av_utilization" current="0" /> <gauge name="case_utilization" current="11" /> <gauge name="bm_utilization" current="0" /> <gauge name="disk_utilization" current="0" /> <gauge name="resource_conservation" current="0" /> <gauge name="log_used" current="4" /> <gauge name="log_available" current="352G" /> <gauge name="conn_in" current="2" /> <gauge name="conn_out" current="0" /> <gauge name="active_recips" current="23" /> <gauge name="unattempted_recips" current="23" /> <gauge name="attempted_recips" current="0" /> <gauge name="msgs_in_work_queue" current="0" /> <gauge name="dests_in_memory" current="11" /> <gauge name="kbytes_used" current="205" /> <gauge name="kbytes_free" current="71302963" /> <gauge name="msgs_in_policy_virus_outbreak_quarantine" current="0" /> <gauge name="kbytes_in_policy_virus_outbreak_quarantine" current="0" /> <gauge name="reporting_utilization" current="6" /> <gauge name="quarantine_utilization" current="0" /> </gauges>
  2. Hi All I have written a script which would take csv file with column and update the device custom property's value. This script works like displayname=~ but If you provide full display name, please change the line 39 to queryParameters = '?fields=id&filter=displayName:'+devicename+'&size=300' CSV file have to have heads and the first column is resource name, the second column is property name and the third column have to have value. #!/bin/ehave value mport pandas as pd import requests import json import hashlib import base64 import time import hmac import csv #Account Info AccessId ='XXX' AccessKey ='YYY' Company = 'abc' filename = raw_input("Enter a CSV name with extention: ") # open the file to read number of rowa. file = open(filename) row = len(file.readlines()) df=pd.read_csv (filename) for r in range (0, row-1): devicename=df.iloc[r,0] print(devicename) #Request Info httpVerb ='GET' resourcePath = '/device/devices' queryParameters = '?fields=id&filter=displayName~'+devicename+'&size=300' data = '' #Construct URL url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath + queryParameters #Get current time in milliseconds epoch = str(int(time.time() * 1000)) #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) #Construct headers auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth} #Make request response = requests.get(url, data=data, headers=headers) #Parse response jsonResponse = json.loads(response.content) #print 'Response Body:',jsonResponse for i in jsonResponse['data']['items']: #print str(i['id']) deviceId = str(i['id']) j=len(deviceId)-3 ##print ('j',j) for i in range (0, j): #Request Info httpVerb ='PUT' proertyname=df.iloc[r,1] resourcePath = '/device/devices/'+deviceId+'/properties/'+proertyname queryParams ='' propertyvalue= df.iloc[r,2] data = '{"value":"'+propertyvalue+'"}' #Construct URL url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath + queryParams #Get current time in milliseconds epoch = str(int(time.time() * 1000)) #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) #Construct headers auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth} #Make request response = requests.put(url, data=data, headers=headers) #print ('Response Status:',response.status_code) print ('Response Body:', str(response.content))
  3. Hi All I have set quotas for several folders on windows 2016 server. I want to monitor these on LogicMonitor. Could you please assist. FYI, please check the attachment for more details. Regards Tanvir
  4. Thanks, Mike vCentre has a custom property esx.tags=true. Also esx.user have read permission to get tags. I am running VMware ESXi 6.5. Based on the document https://www.logicmonitor.com/support/monitoring/os-virtualization/esx-servers-vsphere/#tag in LM, it should work. I can run a PowerShell script but I do not want to unless I have to. Any Idea? Regards Tanvir
  5. Hi All I am running a PowerShell script in a vCentre which tags the VMs based on the parent folder. I want to run a PowerShell a script in LM portal to add those values as a custom property to the devices. Anyone have any idea. Regards Tanvir
  6. LogicMontior should have something to use in a custom query for memberOf() or !memberOf() Also, should have an option for: if I add a property in a group level, that property can be added to the device directly.
  7. Hi all Does anyone have a dashboard for NETAPP and like to share the config (jsaon)? I would be really grateful for that. Regards Tanvir
  8. I Resolved this. Because Service account is not a member of domain admin I had assign RO cluster permission to the service account Grant-ClusterAccess - User dvc_acc -ReadOnly
  9. Hello team, We have hosts with multiple network interfaces, often on the same network but sometimes on different networks. For example, the Linux server Server1 has the IP addresses 130.195.222.222, 130.195.222.223, and 130.95.163.222, with the WebLogic application server listening on the HTTP and HTTPS ports on all three IP addresses but serving up different web sites with different SSL certificates depending upon which you connect to (which is determined by which FQDN you enter into your browser). Connecting a device in LogicMonitor, allows to add only one IP. Does anyone know if LogicMonitor allow us to encapsulate all of this together for a single device? Regards Tanvir
  10. Thanks Kerry I did not but it did not work. Also, to monitor nodes, I cannot even see the following items (as shown in the picture). I think this is a permission issue because service account with domain admin privilege works fine.
  11. @ Matthew Dunham Any update on this?
  12. Hi I have few WFSC servers and trying to Collect from windows systems without admin rights. Account is configured as described in https://www.logicmonitor.com/support/getting-started/advanced-logicmonitor-setup/running-without-administrator-privileges-in-windows/. But it does LM is not collecting any data about CLUSTER SERVICE even the account has a local admin rights. Does anyone know what kind of permissions required to monitor cluster service. Regards Tanvir
  13. Hi All I am trying to create groups with a python script which read a CSV file. my txt file has following information {"name":1","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} {"name":2","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} {"name":3","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} {"name":4","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} when I run the script bellow I receive Invalid JSON body message Response Status: 200 Response Body: b'{"data":null,"errmsg":"Invalid json body","status":1007}' I can create the group if I assign value directly like data ='{"name":1","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"}' Script is
  14. Thanks Joe data = '{\"name\":\"test1111\",\"parentId\":111,\"appliesTo\": \"Type==\\\"Test Server\\\"\"}' worked
  15. Tanvir

    API/Script

    Has been resolved once I change the code for signature. hmac1 = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest()signature = base64.b64encode(hmac1.encode())
  16. Tanvir

    API/Script

    Many many thanks Joe. But now I am having different problem. it creates one group and shows following error. for example it created A22-17 CAPORN STREET group but error appeared during A23-19 CAPORN STREET group creation and script terminated. c:\temp>python cg-csv.py {"name":"A22-17 CAPORN STREET","parentId":150} {"name":"A23-19 CAPORN STREET","parentId":150} Traceback (most recent call last): File "cg-csv.py", line 86, in <module> hmac = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest() AttributeError: 'str' object has no attribute 'new' Script I am running import csv import requests import json import hashlib import base64 import time import hmac build_data = ['{"name":"A22-17 CAPORN STREET","parentId":150}', '{"name":"A23-19 CAPORN STREET","parentId":150}', '{"name":"A24-21 CAPORN STREET","parentId":150}', '{"name":"A25-23 CAPORN STREET","parentId":150}', '{"name":"A26-25A CAPORN STREET","parentId":150}', '{"name":"A28-30 CAPORN STREET","parentId":150}', '{"name":"A29-1/32-38 CAPORN STREET","parentId":150}', '{"name":"A30-33 CAPORN STREET","parentId":150}', '{"name":"A31-35 CAPORN STREET","parentId":150}', '{"name":"A32-37 CAPORN STREET","parentId":150}', '{"name":"A33-12 COOK STREET","parentId":150}', '{"name":"A34-13A COOK STREET (Vacant Land)","parentId":150}', '{"name":"A35-1/21A COOK STREET","parentId":150}', '{"name":"A36-23 COOK STREET","parentId":150}', '{"name":"A37-37 MYERS STREET","parentId":150}', '{"name":"A37-28 COOK STREET","parentId":150}', '{"name":"A38-29 COOK STREET (Vacant Land)","parentId":150}', '{"name":"A39-1/33 COOK STREET","parentId":150}', '{"name":"A40-1/36 COOK STREET","parentId":150}', '{"name":"A41-12 EVERETT STREET","parentId":150}', '{"name":"A42-1/13 EVERETT STREET","parentId":150}', '{"name":"A43-1/14-16 EVERETT STREET","parentId":150}', '{"name":"A44-15 EVERETT STREET","parentId":150}', '{"name":"A45-18 EVERETT STREET","parentId":150}', '{"name":"A46-19 EVERETT STREET","parentId":150}', '{"name":"A47-20 EVERETT STREET","parentId":150}', '{"name":"A48-21 EVERETT STREET","parentId":150}', '{"name":"A49-22 EVERETT STREET","parentId":150}', '{"name":"A50-26 EVERETT STREET","parentId":150}', '{"name":"A51-28 EVERETT STREET","parentId":150}', '{"name":"A52-30 EVERETT STREET","parentId":150}', '{"name":"A53-39 EVERETT STREET","parentId":150}', '{"name":"A54-1/116 FAIRWAY","parentId":150}', '{"name":"A55-1/13 MYERS STREET","parentId":150}', '{"name":"A56-1/15 MYERS STREET","parentId":150}', '{"name":"A57-1/17 MYERS STREET","parentId":150}', '{"name":"A58-19 MYERS STREET","parentId":150}', '{"name":"A59-1/21 MYERS STREET","parentId":150}', '{"name":"A60-1/23 MYERS STREET","parentId":150}', '{"name":"A61-25 MYERS STREET","parentId":150}', '{"name":"A62-27A MYERS STREET","parentId":150}', '{"name":"A63-29 MYERS STREET","parentId":150}', '{"name":"A64-31 MYERS STREET","parentId":150}', '{"name":"A65-33 MYERS STREET","parentId":150}', '{"name":"A66-35 MYERS STREET","parentId":150}', '{"name":"A69-11 PARKWAY","parentId":150}' ] #Account Info AccessId ='XXXXXX' AccessKey ='YYYYYYYY' Company = 'contoso' #Request Info httpVerb ='POST' resourcePath = '/device/groups' l=len(build_data) for i in range (0, l): print (build_data[i]) data = build_data[i] #Construct URL url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath #Get current time in milliseconds epoch = str(int(time.time() * 1000)) #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature #signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) hmac = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest() signature = base64.b64encode(hmac.encode()) #Construct headers #auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch #headers = {'Content-Type':'application/json','Authorization':auth} auth = 'LMv1 ' + AccessId + ':' + signature.decode() + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth} #Make request response = requests.post(url, data=data, headers=headers) #Print status and body of response #print 'Response Status:',response.status_code #print 'Response Body:',response.content
  17. Tanvir

    API/Script

    I want to create device groups which should read lines from text file and create a device group Text file entries like as follows: '{"name":"460-UNIVERSITY HALL - SIR GEORGE CURRIE HALL","parentId":150}' '{"name":"452-AFTER SCHOOL CARE CENTRE (18 PARKWAY)","parentId":150}' '{"name":"453-INDIAN OCEAN MARINE RESEARCH CENTRE (IOMRC)","parentId":150}' In the code If insert data = '{"name":"463-UNIVERSITY HALL - B HOUSE","parentId":150}' # works but If I insert (where line is one line from the txt file) data = line # does not work Code details: #!/bin/env python import requests import json import hashlib import base64 import time import hmac #Account Info AccessId ='XXXXX' AccessKey ='YYYYY' Company = 'contoso' #Open the txt file with open('build.txt') as f: for line in f: #Request Info httpVerb ='POST' resourcePath = '/device/groups' #data = '{"name":"463-UNIVERSITY HALL - B HOUSE","parentId":150}' # works data = line # does not work #Construct URL url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath #Get current time in milliseconds epoch = str(int(time.time() * 1000)) #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature #signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) hmac = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest() signature = base64.b64encode(hmac.encode()) #Construct headers #auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch #headers = {'Content-Type':'application/json','Authorization':auth} auth = 'LMv1 ' + AccessId + ':' + signature.decode() + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth} #Make request response = requests.post(url, data=data, headers=headers)
  18. Hi Members I am trying to create 'Device Dynamic Groups' with Python script. but I am failing. Could you pleas me what I am missing: Conditions of the groups name: If Device display name starts with prod, all device should group. data = '{"name":"test111","parentId":111,"appliesTo":"startsWith("system.displayname","Prod")"}' I have attached the full script too. I am running Python 3.6.5 #!/bin/env python import requests import json import hashlib import base64 import time import hmac #Account Info AccessId ='XXXXXX' AccessKey ='XXXXXX' Company = 'contoso' #Request Info httpVerb ='POST' resourcePath = '/device/groups' data = '{"name":"test111","parentId":111,"appliesTo":"startsWith("system.displayname","Prod")"}' #Construct URL url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath #Get current time in milliseconds epoch = str(int(time.time() * 1000)) #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature #signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) hmac = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest() signature = base64.b64encode(hmac.encode()) #Construct headers #auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch #headers = {'Content-Type':'application/json','Authorization':auth} auth = 'LMv1 ' + AccessId + ':' + signature.decode() + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth} #Make request response = requests.post(url, data=data, headers=headers) Please assist Thank you.
  19. Tanvir

    API/Script

    Issue has been resolved for the error, I had to change the script for version 3.5. Original script is for Python 2.7 #Construct signature hmac = hmac.new(AccessKey.encode(),msg=requestVars.encode(),digestmod=hashlib.sha256).hexdigest() signature = base64.b64encode(hmac.encode()) #Construct headers auth = 'LMv1 ' + AccessId + ':' + signature.decode() + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth}
  20. Tanvir

    API/Script

    Thanks Sarah, Script has been corrected as advised. Now if I run the script I receive the following error >>> signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\00098685\AppData\Local\Programs\Python\Python36-32\lib\hmac.py", line 144, in new return HMAC(key, msg, digestmod) File "C:\Users\00098685\AppData\Local\Programs\Python\Python36-32\lib\hmac.py", line 42, in __init__ raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__) TypeError: key: expected bytes or bytearray, but got 'str'
  21. Hi I want create dynamic groups based on server role like print servers, AD servers, file servers etc. Could you please help me to to find out how can i create a custom query for the groupings or custom query if a service is running. Thank you Tanvir
  22. Tanvir

    API/Script

    Hi I want to create device group named as "Fileserver" in /device/serversThis is the first time I am running the script, so could you please check if my script is ok. Alsoplease let me know how I run this script. I am sharing the script with you. #!/bin/env python import requests import json import hashlib import base64 import time import hmac #Account Info AccessId ='TBA' AccessKey ='TBA' Company = 'contoso' #Request Info httpVerb ='POST' resourcePath = '/device/servers' data = '{"name":"Fileserver"}' #Construct URL url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath #Get current time in milliseconds epoch = str(int(time.time() * 1000)) #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) #Construct headers auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch headers = {'Content-Type':'application/json','Authorization':auth} #Make request response = requests.post(url, data=data, headers=headers) #Print status and body of response print 'Response Status:',response.status_code print 'Response Body:',response.content