Install and Configure Prometheus Server and Node Exporter in RHEL

Install and Configure Prometheus Server and Node Exporter

There are 3 importants components to make sure Prometheus is up and running. We need to install and configure

  1. Prometheus Server,
  2. Node Exporter, and
  3. Dashborad which can be PromDash or Grafana.

Step 1 – Install and configure Prometheus Server in RHEL 7

Download Prometheus
Download Prometheus from https://prometheus.io/download/. You can find 3 Prometheus package which is supported for darwin/linux and windows.

$ sudo -s
$ yum install wget -y
$ cd /opt/
$ wget https://github.com/prometheus/prometheus/releases/download/v2.3.2/prometheus-2.3.2.linux-amd64.tar.gz
$ tar -zxvf prometheus-2.3.2.linux-amd64.tar.gz
$ cd prometheus-2.3.2.linux-amd64

If you find following files….

[root@ip-172-31-21-164 prometheus-2.3.2.linux-amd64]# ls -1
LICENSE
NOTICE
console_libraries
consoles
prometheus
prometheus.yml
promtool

This completes the Prometheus installation.

Verify the installation by typing in the following command:

[root@ip-172-31-21-164 prometheus-2.3.2.linux-amd64]# ./prometheus --version
prometheus, version 2.3.2 (branch: HEAD, revision: 71af5e29e815795e9dd14742ee7725682fa14b7b)
build user: root@5258e0bd9cc1
build date: 20180712-14:02:52
go version: go1.10.3

Step 2 – Install and configure Prometheus Node Exporter in RHEL 7

In order to monitor the metrics of your RHEL server, you should install a tool called Node Exporter. Node Exporter, as its name suggests, exports lots of metrics (such as disk I/O statistics, CPU load, memory usage, network statistics, and more) in a format Prometheus understands.

cd /opt/
wget https://github.com/prometheus/node_exporter/releases/download/v0.16.0/node_exporter-0.16.0.linux-amd64.tar.gz
tar -zxvf node_exporter-0.16.0.linux-amd64.tar.gz
cd node_exporter-0.16.0.linux-amd64
nohup ./node_exporter &

Step 3 — Running Node Exporter as a Service
if you want to Running Node Exporter as a Service

$ sudo vi /etc/systemd/system/node_exporter.service

[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=root
Group=root
Type=simple
ExecStart=/root/prometheus/node_exporter/node_exporter

[Install]
WantedBy=multi-user.target

# Save the file and exit the text editor.

Reload systemd so that it reads the configuration file you just created.

$ sudo systemctl daemon-reload

Enable it so that it starts automatically at boot time.

$ sudo systemctl enable node_exporter.service

You can now either reboot your server, or use the following command to start the service manually:

$ sudo systemctl start node_exporter.service

Once it starts, use a browser to view Node Exporter’s web interface, which is available at http://your_server_ip:9100/metrics. You should see a page with a lot of text:

Step 4 — Starting Prometheus Server

Enter the directory where you installed the Prometheus server:

$ cd /opt/prometheus-2.3.2.linux-amd64

Before you start Prometheus, you must first understand a configuration file for it called prometheus.yml.

[root@ip-172-31-21-164 prometheus-2.3.2.linux-amd64]# more prometheus.yml
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'

# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.

static_configs:
- targets: ['localhost:9090']

Whereas, This creates a scrape_configs section and defines a job called node. It includes the URL of your Node Exporter’s web interface in its array of targets. The scrape_interval is set to 15 seconds so that Prometheus scrapes the metrics once every fifteen seconds.

You could name your job anything you want, but calling it “node” allows you to use the default console templates of Node Exporter. Save the file and exit.

Start the Prometheus server as a background process.

$ nohup ./prometheus > prometheus.log 2>&1 &

You can view the last few lines of the file using the tail command:

$ tail prometheus.log

Once the server is ready, you will see the following messages in the file:

level=info ts=2018-08-21T11:47:38.56459183Z caller=web.go:415 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2018-08-21T11:47:38.569742672Z caller=main.go:543 msg="TSDB started"
level=info ts=2018-08-21T11:47:38.569767659Z caller=main.go:603 msg="Loading configuration file" filename=prometheus.yml
level=info ts=2018-08-21T11:47:38.57069388Z caller=main.go:629 msg="Completed loading of configuration file" filename=prometheus.yml
level=info ts=2018-08-21T11:47:38.570724527Z caller=main.go:502 msg="Server is ready to receive web requests."

Use a browser to visit Prometheus’s homepage available at http://your_server_ip:9090. You’ll see the following homepage.

Step 5 — Verify Prometheus Server
To make sure that Prometheus server is scraping data from Node Exporter, click on the Graph tab at the top of the page. On the page that opens, type in the name of a metric (like up, for example) in the text field that says Expression. Then, press the blue Execute button. Click Graph (next to Console) just below, and you should see a graph for that metric:

More metric can be found from the Node Exporter host such as
http://X.X.X.X:9100/metrics

Prometheus has console templates that let you view graphs of a few commonly used metrics. These console template are accessible only if you set the value of job_name to “prometheus” in Prometheus’s configuration.

Visit http://your_server_ip:9090/consoles/prometheus.html to access the Node Console and click on your server, localhost:9100, to view its metrics.

Step 6 — Installing PromDash Or Grafana…..

Tagged : / / / / /

Install and Configure Grafana in Ubuntu and Debian

Install and Configure Grafana in Ubuntu and Debian

Step 1 – Download & Install Grafana
Download Grafana RPM file RPM for Linux from https://grafana.com/grafana/download?platform=linux

# Ubuntu & Debian
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.2.2_amd64.deb
$ sudo dpkg -i grafana_5.2.2_amd64.deb

Step 2 – Understand Grafana Installation details in Ubuntu/Debian

  1. Installs binary to /usr/sbin/grafana-server
  2. Installs Init.d script to /etc/init.d/grafana-server
  3. Creates default file (environment vars) to /etc/default/grafana-server
  4. Installs configuration file to /etc/grafana/grafana.ini
  5. Installs systemd service (if systemd is available) name grafana-server.service
  6. The default configuration sets the log file at /var/log/grafana/grafana.log
  7. The default configuration specifies an sqlite3 db at /var/lib/grafana/grafana.db
  8. Installs HTML/JS/CSS and other Grafana files at /usr/share/grafana

Step 3 – Start the server (init.d service)

$ sudo service grafana-server start

This will start the grafana-server process as the grafana user, which was created during the package installation. The default HTTP port is 3000 and default user and group is admin.

Step 4 – Configure the Grafana server to start at boot time

$ sudo update-rc.d grafana-server defaults
$ systemctl daemon-reload
$ systemctl start grafana-server
$ systemctl status grafana-server
$ sudo systemctl enable grafana-server.service

Step 5 – Grafana server Environment file
The systemd service file and init.d script both use the file located at /etc/default/grafana-server for environment variables used when starting the back-end. Here you can override log directory, data directory and other variables.

Step 6 – Grafana server Log
By default Grafana will log to /var/log/grafana

Step 7 – Grafana Database
The default configuration specifies a sqlite3 database located at /var/lib/grafana/grafana.db.

You can also use MySQL or Postgres as the Grafana database, as detailed on
http://docs.grafana.org/installation/configuration/#database

Step 7 – Grafana configuration
The configuration file is located at /etc/grafana/grafana.ini. Go the Configuration page for details on all those options. You can add following data sources

  1. Graphite
  2. InfluxDB
  3. OpenTSDB
  4. Prometheus

Step 8 – Server side image rendering
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations, for example in alert notifications.

$ yum install fontconfig
$ yum install freetype*
$ yum install urw-fonts

Step 9 – How to access the Grafana dashboard

http://13.232.27.156:3000/
User name – admin
Password – admin

Tagged : / / / /

Install and Configure Grafana in RHEL 7

Install and Configure Grafana in RHEL 7

Step 1 – Download & Install Grafana
Download Grafana RPM file RPM for Linux from https://grafana.com/grafana/download?platform=linux

# RHEL 7

$ sudo yum install initscripts fontconfig -y
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.2-1.x86_64.rpm
$ sudo yum localinstall grafana-5.2.2-1.x86_64.rpm

Step 2 – Understand Grafana Installation details in RHEL/CENTOS

  1. Installs binary to /usr/sbin/grafana-server
  2. Copies init.d script to /etc/init.d/grafana-server
  3. Installs default file (environment vars) to /etc/sysconfig/grafana-server
  4. Copies configuration file to /etc/grafana/grafana.ini
  5. Installs systemd service (if systemd is available) name grafana-server.service
  6. The default configuration uses a log file at /var/log/grafana/grafana.log
  7. The default configuration specifies an sqlite3 database at /var/lib/grafana/grafana.db

Step 3 – Start the server (init.d service)

$ sudo service grafana-server start

This will start the grafana-server process as the grafana user, which is created during package installation. The default HTTP port is 3000, and default user and group is admin.

Step 4 – Configure the Grafana server to start at boot time

$ sudo /sbin/chkconfig --add grafana-server
$ sudo systemctl enable grafana-server.service
$ systemctl daemon-reload
$ systemctl start grafana-server
$ systemctl status grafana-server

Step 5 – Grafana server Environment file
The systemd service file and init.d script both use the file located at /etc/sysconfig/grafana-server for environment variables used when starting the back-end. Here you can override log directory, data directory and other variables.

Step 6 – Grafana server Log
By default Grafana will log to /var/log/grafana

Step 7 – Grafana Database
The default configuration specifies a sqlite3 database located at /var/lib/grafana/grafana.db. Please backup this database before upgrades.

You can also use MySQL or Postgres as the Grafana database, as detailed on
http://docs.grafana.org/installation/configuration/#database

Step 8 – Grafana configuration
The configuration file is located at /etc/grafana/grafana.ini. Go the Configuration page for details on all those options. You can add following data sources

  1. Graphite
  2. InfluxDB
  3. OpenTSDB
  4. Prometheus

Step 9 – Server side image rendering
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations, for example in alert notifications.

$ sudo yum install fontconfig -y
$ sudo yum install freetype* -y
$ sudo yum install urw-fonts -y


Step 10 – Browse the dashboard
http://X.X.X.X.:3000/
Username – admin
Password – admin

Tagged : / / / / /

How to Install plug-ins in IBM UrbanCode Release

 

Procedure

  1. Download the installation files for one or more plug-ins from the following site: https://developer.ibm.com/urbancode/plugins/ibm-urbancode-build/. Do not extract the compressed files.
  2. Load the plug-ins:
    1. From the IBM UrbanCode Build user interface, click the System tab.
    2. In the Server group, click Plug-ins.
    3. On the Plugins page, Browse and locate the plug-in installation file and then click Open.
    4. On the Plugins page, click Load.

Results

After the upload to the server is complete, the plug-in is listed on the Plugins page and available for immediate use.

Uninstalling a plug-in

To uninstall a plug-in, click System > Plug-ins, locate the plug-in, and then click the Delete icon.

Note: Before uninstalling a plug-in, verify that it is no longer in use. Deleting a plug-in which is being used by existing processes causes those processes to be invalid.

Tagged : / / /

JSHINT

JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team’s coding conventions. It is very flexible so you can easily adjust it to your particular coding guidelines and the environment you expect your code to execute in. JSHint is open source and will always stay this way.

goal

The goal of this project is to help JavaScript developers write complex programs without worrying about typos and language gotchas.

Any code base eventually becomes huge at some point, and simple mistakes—that would not show themselves when written—can become show stoppers and waste hours of debugging. And this is when static code analysis tools come into play and help developers to spot such problems. JSHint scans a program written in JavaScript and reports about commonly made mistakes and potential bugs. The potential problem could be a syntax error, a bug due to implicit type conversion, a leaking variable or something else.

Only 15% of all programs linted on this website pass the JSHint checks. In all other cases, JSHint finds some red flags that could’ve been bugs or potential problems.

Please note, that while static code analysis tools can spot many different kind of mistakes, it can’t detect if your program is correct, fast or has memory leaks. You should always combine tools like JSHint with unit and functional tests as well as with code reviews.

 

How to install and verify version:

npm install jshint

which jshint
/usr/local/bin/jshint

/usr/local/bin/jshint -version
jshint v2.3.0

Tagged : / / / /

Customizing the Firefox Installer on Windows

One of the questions I get asked a lot is how to customize the Firefox installer on Windows and how to bundle extensions with it. I’ve spent the past few days learning a great deal about this subject, so I thought I would take this opportunity to provide a refresher on working with the Firefox installer on Windows. I’m going to do it as a Q&A so hopefully folks will get answers to the common questions they have.

Standard disclaimer: Under no circumstances should you use this information to create a custom Firefox install and redistribute it to anyone outside your organization. If you want more information, you can consult the Mozilla Foundation Trademark Policy.

What tools do I need to work with the Firefox installer?

The primary tool you need is 7-Zip. I install the MozillaBuild package which gives me all the tools I need. Even though the Firefox Installer is NSIS based, we will not need to use NSIS for most customizations. I’ll talk a little bit about the end about what kinds of things you would need NSIS to do.

How do I unpack the Firefox installer?

The Firefox installer is created using 7-Zip. So you can grab any of the Windows installers that end in EXE and unpack them. Any of the Windows installers on the Firefox download page will work. Once you’ve downloaded the EXE, create a temporary directory and type:

7z x "Firefox Setup 3.6.3.exe"

This will unpack the contents of the installer so we can modify it.

How do I bundle my extension with the Firefox installer?

Bundling your extension with the Firefox installer is just a matter of putting it in the right place. Then when we package up the installer at the end, it will get installed along with Firefox. For most extensions, the right place is nonlocalized/extensions. Inside that directory, create a subdirectory that corresponds to the ID of the extension you want to preinstall with Firefox. Then unzip the XPI into that directory. You can find the ID by looking at the install.rdf file inside the XPI. You can add as many extensions as you want into the installer.

What are some useful extensions I can bundle with Firefox

I’ve created two extensions that create interesting things to bundle with Firefox. The first is the CCK Wizard. The CCK Wizard can be used to change various defaults in Firefox so that you can customize it for deployment in your organization. The second is Rebrand. Rebrand allows you to change the internal branding used in Firefox.

Can I change the names used in the installer?

Yes, you can change the names used in the installer. To do this, you need to create a directory called distribution inside the localized directory that was created when you unpacked the installer. Create a file called setup.ini in this directory. Here’s what it looks like:

[Branding]
BrandFullName=Mike's Browser
BrandShortName=Browser

BrandFullName will be used to replace “Mozilla Firefox” and BrandShortName will be used to replace “Firefox”.

Can I change the images used in the installer?

Yes, you can change the images used in the installer. In that same directory where you put the setup.ini, you can put two files, modern-wizard.bmp and modern-header.bmp. The first images corresponds to the large image on the first page of the installer. The second image corresponds to the small image that is used on later pages of the installer. You can use the linked images as a reference to know what size to make these images.

How do I repackage the installer?

To repackage the installer, first you need to zip up the changes that you made. Type:

7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3

This will create a file called app.7z that has all the changes we made. Now we need to package that file with some other files to create the final EXE. We’ll need the file 7zSD.sfx which you can download from Mozilla. And we’ll need a file called app.tag which you can create. It looks like this:

;!@Install@!UTF-8!
Title="Mozilla Firefox"
RunProgram="setup.exe"
;!@InstallEnd@!

Once we have these files, we can run the command:

copy /B 7zSD.sfx+app.tag+app.7z our_new_installer.exe

to package them all as an EXE. Don’t forget the /B. It indicates that the files are binary so Windows won’t put an EOF marker on them.

Can I change the defaults that are set in the installer like the install directory or the checkboxes?

At this time, there is no way to change the defaults in the installer without rebuilding the installer. There’s a bug open on this with a patch, so hopefully this will be fixed for Firefox 4.

Can I make my totally rebranded Firefox coexist nicely with an existing Firefox?

There are a couple ways to do this. The easiest way is to use the -no-remote parameter when you start Firefox. This causes the Firefox you are starting to not connect to the Firefox that is currently running. When you do this, you have to specify a different profile using the -P parameter. Alternatively, you can change the internal identifiers that Firefox uses. Then it will be considered to be a completely different browser. If you choose to do this, you should be aware that you will not receive updates and there will be other side effects. This is not a decision that should be taken lightly. Also, your profiles will be stored in different locations as well. If you want to do this, check out the file application.ini in the nonlocalized directory. The variables you want to change are Vendor and Name. Again, you do this at your own risk.

What can I do if I’m willing to rebuild the installer with NSIS?

If you are willing to rebuild the installer, you can change things like the name of the entry in the Add/Remove programs list, as well as the install directory and other defaults. This is a nontrivial exercise because some of the required files are built as part of the Mozilla build proces and are not available in the build tree. If you’re really interested in doing this, you can contact Kaply Consulting and we can talk about it.

I hope this answered some questions folks have. If anyone has any more questions, please don’t hesistate to ask.

Tagged : / / / / /

What is Smart Install Maker and its usage?

created the topic: What is Smart Install Maker and its usage?
Smart Install Maker

At last! There is now a much smoother and faster way to create setup files for easy installation of applications. As a developer, you will no longer be bogged down learning complex installation programs or yet another awkward scripting language. This guarantees hassle-free programming, quicker market delivery and ultimately a faster turnaround with more satisfied users. Smart Install Maker enables the creation of a professional-looking, custom-made setup file in just a few mouse clicks. The simplicity of Smart Install Maker means:
* No Scripts
* No brain twisters
* No unreasonable charges

Scripting for GUI now takes minutes – not weeks!

Creating professional setup files used to require script-powered installers, which meant learning new scripting languages and mastering complex installer maker solutions. Now there is an easier way to create great setup files.

It used to take weeks learning extremely difficult scripting language or mastering a complex setup builder, which on top of everything else was very expensive. Now it is possible to take advantage of the wizard-driven Smart Install Maker, which takes just a few minutes and a few mouse clicks to create a professional installation package. These packages are perfect for distributing over the internet, via disc or other media.

Smart Install Maker – Features

Easy, customizable and expert-level setup files:

* Create smaller setup files with built-in Ñab compression. Smaller size distributives are quicker to download and give users a better installation experience.
* Control installation and uninstallation – decide the method, time and contents of installation, modification or removal (including registry, .ini and config files).
* Check system requirements automatically. If the current system does not comply with the minimum requirements, the installer can notify the user of the problem or automatically abort installation.
* Customize the installation environment and appearance of wizard screens (eg add gradients or images to the window background, add header image, logo image, etc).
* Customize screens for display during installation (eg license agreements, readme files, etc).
* Use the OS native language: automatically identify the language of the target operating system and adjust the screen and message language settings accordingly.
* Execute custom commands, operate with installer variables, verify passwords, customize uninstall, manage uninstall feedback.
* Ensure a clean uninstall with no leftovers or orphan files, folders, services or registry records.
* Create silent installations that do not display installation dialogs and messages.
* Cut development time. Avoid learning new languages or complex software – get hold of the intuitive GUI and enjoy the speedy setup creation process.
* Don’t just pay for a brand name without power or quality! Although Smart Install Maker is low cost, it does not offer useless features like many other supposedly superior products.

Tagged :

Wise package install permissions

deployexpert created the topic: Wise package install permissions
I created a Wise package (ToolWatch SE) so our tech can install it as needed. The problem is i am the only one who can install it. When someone else runs the job it appears to be installing, but when it completes nothing has been installed. When the techs push the job using the DS console it gets an 1603 error (permissions). When i push it the job installs fine. I have created many Wise packages before and have never had this problem before. Is there some place within the package that i can check for permissions?

applicationPackaging replied the topic: Re: Wise package install permissions
You need to install/deploy with verbose logging to check where it actually “breaks”.
Enable the Logging policy it on the client or add it through the command line execution.

deployexpert replied the topic: Re: Wise package install permissions
i am not familiar with that, can u give me some more info or refer me to another link that will provide some more help on how to do this.

Thank you for the help

applicationPackaging replied the topic: Re: Wise package install permissions
How to enable Windows Installer logging
support.microsoft.com/kb/223300

deployexpert replied the topic: Re: Wise package install permissions
BTW, 1603 is a generic error, nothing to do with permissions. That’s not to say, of course, that the issue isn’t connectesd with permissions, just that 1603 isn’t specifically pointing to that.

applicationPackaging replied the topic: Re: Wise package install permissions
You can create a log for your package and see where the package stops and gives that error. With that you can search in the package and could understand why the errors is given.

Tagged :

What is CreateInstall?

created the topic: What is CreateInstall?
The ideology behind the CreateInstall installer is based on two main principles. Complete control over the installation process and unlimited scalability. If you want to know what your installation package does step by step and want to it to perform certain operations at certain times, CreateInstall is your choice. If other installers lack some features, it is highly probable that these features are already implemented or can be implemented in CreateInstall. Your requirements for your installation packages may change, but CreateInstall will not limit them.

For More Info…
www.createinstall.com/

Tagged :

what is Remote Install Mac OS X?

deployexpert created the topic: what is Remote Install Mac OS X?
Remote Install Mac OS X is a remote installer for use with MacBook Air laptops over the network. It works by having it run on a Macintosh or a Windows-based PC with an optical drive and then connecting over the network to a client MacBook Air (lacking an optical drive) to perform system software installs.

Remote Install Mac OS X was released as part of Mac OS X 10.5.2 on February 12, 2008.

The March 2009 Mac mini now also supports Remote Install, allowing the DVD drive to be replaced with a second hard drive.

Tagged :