Index of /userside/modules/usm_observer

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[DIR]venv/2025-08-21 00:44 -  
[TXT]usm_observer.py2018-02-27 15:10 11K 
[   ]settings.ini-example2017-10-05 18:33 434  
[   ]settings.ini2019-01-31 12:55 460  
[TXT]requirements.txt2017-10-05 18:33 7  
[   ]README.pdf2018-02-27 15:37 64K 
[TXT]README.html2018-02-27 15:35 3.8K 

About

usm_observer - external module for ERP USERSIDE. The module monitors various parameters of the active equipment using the SNMP protocol.

Install

Environment

Linux

Debian, Ubuntu and other based on Debian

apt-get install python3
python3 -m ensurepip

or

apt-get install python3-pip

CentOS

yum -y install yum-utils
yum -y groupinstall development
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u
yum -y install python36u-pip

Next, everywhere, instead of python3, you should use python3.6 and instead of pip3, you should use pip3.6.

FreeBSD

pkg install python3
python3 -m ensurepip

Module

unzip usm_observer-vX.X.X.zip
rm usm_observer-vX.X.X.zip
cd usm_observer
pip3 install --upgrade pip
pip3 install -r requirements.txt
cp settings.ini-example settings.ini

Test run

Run once the module manually:

python3 usm_observer.py

There should be no errors at startup either in the console or in the logs.

If there are errors, fix them and start them manually again.

If there are no errors, set to start automatically by the crontab.

Scheduled run (crontab)

Add to crontab this entry:

*/2 *   * * *   root    python3 /path/to/module/usm_observer.py >> /var/log/userside/usm_observer_cron.log 2>>/var/log/userside/usm_observer_cron_error.log

Instead of the path /var/log/userside, enter your real log path as specified in the settings.ini.

Make sure that the module is started by the cron normally.

You may have to add a path to python3 in crontab file, or specify the full path instead of python3.

Logrotate

Linux

Use the logrotate service.

Create the file /etc/logrotate.d/userside, if it does not already exist, and add the following lines to it:

/var/log/userside/*.log {
    rotate 7
    daily
    compress
    delaycompress
    missingok
    notifempty
}

FreeBSD

Use the newsyslog service.

Create the file /usr/local/etc/newsyslog.conf.d/userside, if it does not already exist, and add the following lines to it:

/var/log/userside/*.log             644  7      *    @T00  GJC