pydash is a lightweight web-based monitoring tool for Linux written in Python and Django plus Chart.js. It has been tested and can run on the following mainstream Linux distributions: CentOS, Fedora, Ubuntu, Debian, Arch Linux, Raspbian as well as Pidora.
You can use it to keep an eye on your Linux PC/server resources such as CPUs, RAM, network stats, processes including online users and more. The dashboard is developed entirely using Python libraries provided in the main Python distribution, therefore it has a few dependencies; you don’t need to install many packages or libraries to run it.
In this article, we will show you how to install pydash to monitor Linux server performance.
How to Install pyDash in Linux System
1. First install required packages: git and Python pip as follows:
-------------- On Debian/Ubuntu -------------- $ sudo apt-get install git python-pip -------------- On CentOS/RHEL -------------- # yum install epel-release # yum install git python-pip -------------- On Fedora 22+ -------------- # dnf install git python-pip
2. If you have git and Python pip installed, next, install virtualenv which helps to deal with dependency issues for Python projects, as below:
# pip install virtualenv OR $ sudo pip install virtualenv
3. Now using git command, clone the pydash directory into your home directory like so:
# git clone https://github.com/k3oni/pydash.git # cd pydash
4. Next, create a virtual environment for your project called pydashtest using the virtualenv command below.
$ virtualenv pydashtest #give a name for your virtual environment like pydashtest
Important: Take note the virtual environment’s bin directory path highlighted in the screenshot above, yours could be different depending on where you cloned the pydash folder.
5. Once you have created the virtual environment (pydashtest), you must activate it before using it as follows.
$ source /home/aaronkilik/pydash/pydashtest/bin/activate
From the screenshot above, you’ll note that the PS1 prompt changes indicating that your virtual environment has been activated and is ready for use.
6. Now install the pydash project requirements; if you are curious enough, view the contents of requirements.txt using the cat command and the install them using as shown below.
$ cat requirements.txt $ pip install -r requirements.txt
7. Now move into the pydash directory containing settings.py or simple run the command below to open this file to change the SECRET_KEY to a custom value.
$ vi pydash/settings.py
Save the file and exit.
8. Afterward, run the django command below to create the project database and install Django’s auth system and create a project super user.
$ python manage.py syncdb
Answer the questions below according to your scenario:
Would you like to create one now? (yes/no): yes Username (leave blank to use 'root'): admin Email address: [email protected] Password: ########### Password (again): ############
9. At this point, all should be set, now run the following command to start the Django development server.
$ python manage.py runserver
10. Next, open your web browser and type the URL: http://127.0.0.1:8000/ to get the web dashboard login interface. Enter the super user name and password you created while creating the database and installing Django’s auth system in step 8 and click Sign In.
11. Once you login into pydash main interface, you will get a section for monitoring general system info, CPU, memory and disk usage together with system load average.
Simply scroll down to view more sections.
12. Next, screenshot of the pydash showing a section for keeping track of interfaces, IP addresses, Internet traffic, disk read/writes, online users and netstats.
13. Next is a screenshot of the pydash main interface showing a section to keep an eye on active processes on the system.
For more information, check out pydash on Github: https://github.com/k3oni/pydash.
That’s it for now! In this article, we showed you how to setup and test the main features of pydash in Linux. Share any thoughts with us via the feedback section below and in case you know of any useful and similar tools out there, let us know as well in the comments.
It is running successfully but I am not getting result of memory, cpu in browser please help me anybody if i may miss anything?
@Mani,
Wait sometime to gather data from the system..
it is moved to gitlab. https://gitlab.com/k3oni/pydash
How can you retrieve data from a remote server with this program??
@Lazaro,
Unfortunately, PyDash only monitor the current server, where it is installed, for remote monitoring Use Glances to Monitor Remote Linux in Web Server Mode
Error running –
(pydashtest) [harneesi@oc6435377758 pydash]$ python manage.py syncdb
Traceback (most recent call last):
File “manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/core/management/__init__.py”, line 399, in execute_from_command_line
utility.execute()
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/core/management/__init__.py”, line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/core/management/__init__.py”, line 261, in fetch_command
commands = get_commands()
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/core/management/__init__.py”, line 107, in get_commands
apps = settings.INSTALLED_APPS
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/conf/__init__.py”, line 54, in __getattr__
self._setup(name)
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/conf/__init__.py”, line 50, in _setup
self._configure_logging()
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/conf/__init__.py”, line 72, in _configure_logging
from django.utils.log import DEFAULT_LOGGING
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/utils/log.py”, line 7, in
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/views/debug.py”, line 12, in
from django.template import Template, Context, TemplateDoesNotExist
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/template/__init__.py”, line 53, in
from django.template.base import (ALLOWED_VARIABLE_CHARS, BLOCK_TAG_END,
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/template/base.py”, line 19, in
from django.utils.html import escape
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/utils/html.py”, line 14, in
from .html_parser import HTMLParser, HTMLParseError
File “/tmp/pydash/pydashtest/lib/python3.6/site-packages/django/utils/html_parser.py”, line 12, in
HTMLParseError = _html_parser.HTMLParseError
AttributeError: module ‘html.parser’ has no attribute ‘HTMLParseError’
Traceback (most recent call last):
File “manage.py”, line 8, in
when I run: python manage.py sysncdb
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
(pydashtest)
What am I doing wrong I follow the step to the tee. I am running Ubuntu 16.04 Server
This project is very old, stalled for two years.
I tried to use it with Python 3.6 and Django 1.11, doesn’t work.
@Luis
Thanks for the feedback, we’ll check this out.
Is there a way to use it as a command center & monitor multiple linux terminals at one place or is it a singular host monitoring software?
@Samar
I suppose it only monitors a single Linux system, however, it allows remote data retrieval but this may not necessarily mean monitoring other systems.
Hi,
How can i change the port number & when i visit following URL
http://mydomainname.com:8000/
i get following error
This site can’t be reached
@Thenraja
Run the command like so:
Where 1000 is your test port, make sure the port is being used.
And open the link from the terminal(this will open automatically in the browser).
It’s hard to beat netdata these days, but it’s always nice to have alternatives.
@Zach
Yap, alternatives give different options.
Thanks for sharing this, can we manage Number of servers from this tool? Like central monitoring server?
Thanks
Saeed
@Saeed
It only monitors a single Linux system but allows retrieval of remote data.