CyberKeeda In Social Media
Showing posts with label Monitoring Tools. Show all posts
Showing posts with label Monitoring Tools. Show all posts

How to install and configure SignalFX Smart Agent on Windows Server

SignalFX Smart Agent.

Signal FX ships with SFX Smart agent, which is one of the essentials to monitor IT infrastructure (Hosts), using it we can monitor the below infrastructure resources 
  • Memory
  • CPU
  • Disk
  • Network
  • Disk IO
  • Network IO
Signal FX official documents suggest to install it via Power Shell script, that can be found within it's setup tab.

Within this blog post, we will cover how to install and configure SFX Smart Agent on Windows server from packaged ZIP file.

Assumptions and Requirements:
  • We already have accounts on Signal FX with required licenses.
  • We will be using Windows Server 2012 in our lab setup as a host.
  • I will install SignalFxAgent-4.20.2-win64.zip here.
  • Strings highlighted in RED within this post, must be replaced by your own values.
So before we proceed we need to gather three important and mandatory inputs
  • signalFxAccessToken
  • ingestUrl
  • apiUrl
All three can be extracted from the Setup tab, lets know it step by step.
  1. Login to your Signal FX Account.
  2. On the header navbar, click on integrations.
  3. Under essential services, click on SignalFX Smart Agent.
  4. Toggle to SETUP tab.
  5. Scroll down to the Windows Section.
  6. Copy the content on Windows setup and paste it into Notepad.
  7. Look for (apiUrlcan, ingestUrl, signalFxAccessToken) within the pasted strings within notepad, extract and keep it handy to use it further into our configuration file.



Setup.

Signal FX Smart Agent mandatory requirements, so before we proceed further to install agent on our windows host, make sure we have both the below packages installed within our host.
  1. Net Framework 3.5 or higher.
Now let's move forward to setup.

  • Download the latest SFX Smart Agent for windows from github page -Download 
  • Extract and copy the content within your host to any directory of your choice, i am copying it into C:\Program Files.
  • Toggle into "etc" within extracted SignalFxAgent directory, as per mine setup location is C:\Program Files\SignalFxAgent\etc\signalfx.
  • Configure agent.yaml file.
Below is the sample configuration for agent.yaml, replace the highlighted one in red with the one you have extracted within previous steps.

---
# *Required* The access token for the org that you wish to send metrics to.
signalFxAccessToken: 'myRandonTokenGivenBySignalFx'
ingestUrl: 'https://ingest.us1.signalfx.com'
apiUrl: 'https://api.us1.signalfx.com'
intervalSeconds: 10

logging:
  # Valid values are 'debug', 'info', 'warning', and 'error'
  level: info

# observers are what discover running services in the environment
observers:
  - type: host

monitors:
  - {"#from": 'C:\Program Files\SignalFxAgent\etc\*.yaml', flatten: true, optional: true}
  - type: host-metadata
  - type: processlist
  - type: cpu
  - type: disk-io
  - type: filesystems
  - type: memory
  - type: net-io
  - type: vmem

enableBuiltInFiltering: true
  • So we have made the required changes within agent.yaml, now save and exit, we are done with the config file setup.
  • Now let's install it and make it as a windows service, run the below command to install it.
Toggle again to the "SignalFxAgent" director, mine is "C:\Program Files\SignalFxAgent\" and run the install command to install it, replace the one highlighted in red by your own path.

PS C:\> cd C:\Program Files\SignalFxAgent\

 PS C:\Program Files\SignalFxAgent> bin\signalfx-agent.exe -service "install" -logEvents -config "C:\Program Files\Signal
FxAgent\etc\signalfx\agent.yaml"
This will create SignalFX Smart Agent as a Windows Service, we can stop and start from their as per our need.

In case if you are willing to start the services by command prompt, below is the command.
 PS C:\Program Files\SignalFxAgent> bin\signalfx-agent.exe -service "start"
Upon successful setup, we can find our configured host under SingnalFX Infrastructure Navbar as below.




Read more ...

An introduction to Dashing and Smashing dashboard frameworks


Dashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.

You can go through the slide to have a intro about it.




Read more ...

How to Use Sumologic API

Sumo Logic

If you are new to sumo, it's a kind of log aggregating tool that can be used further for data representational, monitoring, analytics and many more, Splunk is an industrial well know application within the same industry and market as a competitor.

Sumo Logic API

Apart from a very interactive GUI, Sumo Logic exposes APIs to access resources and log data from third-party scripts and applications, and also to configure Sources via JSON.


How to use.

Authentication :  Sumo Logic provides two methods of authentication
  1. Access Id and Access Key
  2. Base64 encoded accessid and access key
In this post, we will cover point 1, that is authentication using accessid and accesskey.
First, let's generate a pair of accessid and accesskey.

Login to your sumo logic account --> Expand the left navbar --> scroll down to bottom click to expand on your account name --> Preferences --> Add Access Key --> Generate and Save.




Now you are ready with the AccessID and Accesskey, we will move to test authentication using credentials.

Before we proceed, you must know API endpoints of your as this will be used further.
So we have our access credentials ready and we know our api endpoint, below one liner can be used to authenticate Sumo Logic API endpoints.

Do replace your Accessid, Accesskey and API endpoints by yours one, don't worry if you get a 404 response it's expected.

curl -u "<accessId>:<accessKey>" -X GET <API Endpoint>

Expected response :  <title>Error 404 Not Found</title>


Sumo Logic Search JOB API

The search job API provides third part scripts and applications access to your log data after using mandatory above authentication, it can be used further as per requirement.

Mandatory Requirements 

  • If you are familiar with searches in sumo, you must be aware that some complex and large time drift queries takes more time then usual, keeping in mind this scenario once a search job request is initiated, it must be keep alive/running by polling for status of the provided job id upon submitting search job request. If not done so, a search job is cancelled after five minutes of inactivity.
  • You must enable cookies for subsequent request to Search Job API.
  • Access ID and Access Secret.
  • Valid API endpoint.
  • Valid Search String in JSON format.


Creating a Search Job using API.
Create a empty JSON document/file and paste the below content and replace it by your own data.

{
          "query": "| _collector=my_prod_collect_01| count",
          "from": "2019-07-28T12:00:00",
          "to": "2019-07-28T13:10:00",
          "timeZone": "GMT"
}

Query ( type : String ) -- Replace it by your own SumoLogic search query.
From ( type: String )   -- Replace if by yours with format like YYYY-MM-DDTHH:mm:ss
To ( type: String )         -- Replace if by yours with format like YYYY-MM-DDTHH:mm:ss
TimeZone ( type: String )  -- Replace if by yours with timezone (ie : GMT,PST,DST) etc 

Create  One liner to submit search to grab search id.
curl -b cookies.txt -c cookies.txt -H 'Content-type: application/json'  -H 'Accept: application/json' -X POST -T mytest.json  --user "ACESSID:ACCESSKEY"  https://api.us2.sumologic.com/api/v1/search/jobs 

Expected response

{
  "id": "1EE8BFBCD715",
  "link": {
    "rel": "self",
    "href":"https://api.us2.sumologic.com/api/v1/search/jobs/1EE8BFBCD715"
  }
}

Where "1EE8BFBCD715""is your search job id, that could be used to find search job result using below one liner.


curl -b cookies.txt -c cookies.txt -H 'Accept: application/json' --user ACESSID:ACCESSKEY https://api.us2.sumologic.com/api/v1/search/jobs/1EE8BFBCD715

Expected Response.

{
  "state": "DONE GATHERING RESULTS",
  "histogramBuckets": [
    {
      "startTimestamp": 1567663200000,
      "length": 3600000,
      "count": 7380
    },

Try to post your queries, will try to help you with errors.


Read more ...

NagiosXI: Download pdf Couldn't create temporary file.





Couldn't create temporary file. Check that the directory permissions for the /temp directory are set to 777








Login as root to the Nagios server and run the following.



chown -R  nagios.nagios /usr/local/nagiosxi/html/includes/components/highcharts/exporting-server/temp
chmod -R  ug+rwx /usr/local/nagiosxi/html/includes/components/highcharts/exporting-server/temp
Read more ...

nagios 4.0.8 fails to start with "Error:




nagios 4.0.8 fails to start with "Error: Failed to initialize query handler" (bind() failed: No such file or directory)

qh: Failed to init socket '/usr/local/nagios/var/rw/nagios.qh'. bind() failed: No such file or directory

error: Failed to initialize query handler. Aborting


Nagios Core responds me these errors while starting nagios.

Fix : Error itself give us an hint about no directory error, hence leading to failure while starting  the service.

Fix:  To fix this issue I will create the missing directory manually and aligning permissions to it.



  • Depending upon your error of missing directory create it.

cybeerkeeda@Linux-Maniac:~ mkdir -p  /usr/local/nagios/var/rw/
  • Provide full permission to it.
cybeerkeeda@Linux-Maniac:~ chmod -R 777  /usr/local/nagios/var/rw/
  • Restart Nagios again
cybeerkeeda@Linux-Maniac:~ sudo service nagios restart




Read more ...
Designed By Jackuna