Skip to main content
All CollectionsThe Panorama9 AgentConfiguration
Configure the P9 Agent for Linux
Configure the P9 Agent for Linux
IT-Man avatar
Written by IT-Man
Updated over a week ago

Table of contents

Once the Panorama9 Agent has been installed it will run silent in the background collecting information about the machine and forward it to the Panorama9 cloud. The agent is automatically updated when a new version is released.

Start, stop, restart and check status of the P9 Agent

During boot of the computer the Panorama9 Agent for Linux will automatically start. If you edit the configuration files you must restart the Agent before the changes are used. To restart the Agent do:

$ sudo /etc/init.d/p9agent restart

You can verify if the Agent is running with:

$ /etc/init.d/p9agent status

To force the Agent to stop:

$ sudo /etc/init.d/p9agent stop

Suspend notifications during maintenance work

From time to time you're required to do maintenance work on e.g. a server. Any monitored services that you stop will naturally result in Panorama9 generating an issue and possible send you a notification. Rebooting the server would result in even more notifications coming your way. Until you've completed your work a stream of disturbing and needless notifications could be filling up your inbox. This is easily avoided by temporarily suspending notifications.

The Panorama9 Agent for Linux allows you to suspend notifications using the command line tool "p9-suspend-notifications" (only a privileged user may invoke it). Add it to maintenance cron jobs or just use it when you wish to silence the Panorama9 cloud.

$ p9-suspend-notifications --help

Usage: p9-suspend-notifications [ options ]

-------------------
Requered arguments:

-d, --duration MIN
 Suspend notifications the next MINUTES
or
-c, --cancel
 Cancel suspend notifications request
 (this will force set --type to [cancel])

-------------------
Optional arguments:

-t, --type TYPE
 Type of maintenance work, e.g. unplanned or planned
 (optional)

--description TEXT
 Description of maintecance work, e.g. "apply patches and reboot server"
 (optional)

-p, --plugins-conf PATH
 Path to plugins configuration file
 (default: /etc/P9/agent/plugins.conf)

--version
 Show version information

--help
 This message

--------------------
Examples:

 $ suspend-notifications -d 60
or
 $ suspend-notifications -d 120 -t planned --description "add new hard drive"
or
 $ suspend-notifications --cancel

User message

Send message to the user that's physical logged into the device

$ p9-user-message -h

(Note: The "-h" argument lists available command line arguments that must be entered)

Check connectivity to the Panorama9 cloud

To check if the Panorama9 Agent for Linux is able to communicate with the Panorama9 cloud do:

$ p9-check-connectivity
Successfully connected to the Panorama9 cloud: <tower.panorama9.com>

If the Agent is able to successful establish a connection you'll get the above reply. If it fails, you'll see a reply explaining the error and exit status will be non-zero.

Sync with the Panorama9 cloud

You may force the device to sync information with the Panorama9 cloud by restarting the agent. Useful if you have e.g. updated software and wish the Panorama9 system to instantly reflect this.

$ sudo /etc/init.d/p9agent restart

Change classification of machine from "computer" to "server"

The Panorama9 backend will try to guess if your Linux machine is a server or a regular workstation (you should care about this because there is a difference in what is being monitored). However, this is a tough one to guess, so if we've got it wrong you can easily change it.

To do this, you'll have to edit the Panorama9 configuration file:

$ sudo vi /etc/P9/agent/plugins.conf

edit: #is_server = 1 should be un-commented and then ”1” will classify the machine as a server in the Dashboard and “0” will classify it as a computer. That’s it.

After changing this the P9 Agent should be restarted (see above).

Specify path to file with CPU temperature

The Panorama9 Agent will try to read the CPU temperature using lm-sensors. When lm-sensors fails or isn't available, then fall back is to use sysfs and read the temperature from /sys/class/thermal/thermal_zone0/temp. Should your system store the CPU temperature in a different location you can edit the Panorama9 configuration file and set correct path:

$ sudo vi /etc/P9/agent/plugins.conf

edit: # cpu_temp = path to file with CPU temperature

After changing this the P9 Agent should be restarted (see above).

Daemons or services that the Panorama9 Agent should monitor

You can configure the Panorama9 Agent for Linux to check the status of daemons and services. If a daemon or service terminates an issue is generated and if desired a notification can also be sent to you. When the daemon or service runs again the issue will be cleared and a new status notification sent.

To configure which daemons and services that should be monitored edit the "service configuration file":

$ sudo vi /etc/P9/agent/services.conf

You can enter "path to pid files" or "process names". A pid file is typically created in the folder "/var/run" during startup of a daemon. When checking status of the daemon the Panorama9 Agent for Linux first verifies that the pid file exists and next ensures the process is running. If the daemon that should be monitored doesn't create a pid file, you may choose to let the Panorama9 Agent for Linux search the process list for a specific "process name". When multiple processes with same name exists, e.g Apache will spawn children with names equal to the parent process, then the oldest pid is used.

To monitor e.g. the Apache daemon using the "path to pid file", add the following line to the "service configuration file":

/var/run/apache2.pid:apache

(format: path_to_pid:display_name. The display name is optional. If defined then issue text seen in the Panorama9 Dashboard and notifications will contain the given "display name".)

To monitor e.g. MySQL daemon using the "process name", add the following line to the "service configuration file":

mysqld:mysql

(format: process_name:display_name. The display name is optional.)

After making configuration changes to the "service configuration file" verify everything is working as expected using the the "p9-check-service" command line tool. Then restart the Panorama9 agent for Linux (see above).

Proxy

The Panorama9 Agent for Linux can communicate with the Panorama9 cloud using a proxy service. To configure proxy settings either define the 'https_proxy' environment variable, or edit the file "/etc/P9/agent/plugins.conf" (recommend).

Important: if using the 'https_proxy' environment variable it must be define for the user running the Panorama9 Agent (default user is 'p9').

$ export https_proxy=http://proxy.example.com:3128

Virtual hardware and entropy

The Linux random number generator is a special device (/dev/random) used by services during encrypted communication. On a virtual system with little hardware interrupts (keyboard, mouse, disk activity, etc.) there may not be enough available randomness to avoid blocking conditions.

The Panorama9 Agent for Linux talks with the Panorama9 Cloud using HTTPS (SSL/TLS), and when little entropy is available communication becomes unstable. The result isn't predictive behaviour and unreliable monitoring, such as the monitored device being considered offline by the Panorama9 system or slow boot.

The Panorama9 Agent for Linux will display a warning during startup when virtual hardware is detected and with instructions on how to ensure enough entropy is available. Two options are suggested, either will do.

Option 1) Switch to non-blocking /dev/urandom:

$ sudo mv /dev/random /dev/random.orig; sudo ln -s /dev/urandom /dev/random

Note: On some systems this must be done at every boot (since the original /dev/random is restored).

Option 2) Install the HAVEGE daemon:

$ sudo apt-get install haveged

or

$ sudo yum install haveged
Did this answer your question?