Skip to main content

plugin integration tool

Project description

system argument requirements

server            = sys.argv[1]
database          = sys.argv[2]
username          = sys.argv[3]
password          = sys.argv[4]
driverLocation    = sys.argv[5] 
query             = sys.argv[6] # EXEC sql command to execute
thisPluginName    = sys.argv[7]

example input

python main.py localhost testdb sa password /usr/local/lib/python3.6/dist-packages/pyodbc/drivers/pyodbc.so "select * from testtable" testplugin

what is expected query(EXEC) input and expected output?

const rows = database.exec(query); 
console.log(rows);
// [(0, 'key', 'value'), (1, 'dev', 'renas'), ...rows]

const fs = require('fs');
console.log(fs.readFileSync('/tmp/testplugin.cache', 'utf8'))
// {
//     "plugin_version": "2",
//     "heartbeat_required": "true",
//     "CPU": 100,
//     "server": "localhost",
//     "database": "testdb",
//     "driverLocation": "/usr/local/lib/python3.6/dist-packages/pyodbc/drivers/pyodbc.so",
//     "query": "select * from testtable",
//     "thisPluginName": "testplugin",
//     "key": "value",
//     "dev": "renas"
// }

HOW-TOs

how to see how many plugin this server has on site24x7.com

  • 48 plugins on 06
  • 111 plugins on 05 # this SERVER also did not let me install 3 diffirent plugins on site24x7.com
await page.goto('https://site24x7.com/plugins/');
await page.evaulate(()=>{
    return document.querySelectorAll(".cursor.ng-scope").length;
}).then(result=>{
    console.log(result);
}).catch(error=>{
    console.log(error);
}).finally(()=>{
    browser.close();
}).then(()=>{
    console.log('done');
});

jenkins run command

if pip3 list | grep -F site24x7; then
    echo "site24x7 is installed"
else
    echo "site24x7 is not installed, installing it right now..."
    pip3 install site24x7 --force-reinstall
fi

# below can be stored in a file and run with python3
server="localhost" 
database="testdb" 
username="sa" 
password="password" 
driverLocation="/usr/local/lib/python3.6/dist-packages/pyodbc/drivers/pyodbc.so"
#################################################
# below cant
query="select * from testtable"
thisPluginName="my_testing_plugin"
#################################################
python main.py $server $database $username $password $driverLocation "$query" $thisPluginName

site24x7_plugin_helper script location after installation

ls '/usr/local/lib/python3.7/dist-packages/site24x7_plugin_helper/'

how to fast and secure plugin placing on bash

PLUGIN_NAME="testplugin"
echo "installing $PLUGIN_NAME"
mkdir /opt/site24x7/monagent/plugins/$PLUGIN_NAME
mv .env /opt/site24x7/monagent/plugins/$PLUGIN_NAME/.env
mv $PLUGIN_NAME.py /opt/site24x7/monagent/plugins/$PLUGIN_NAME/$PLUGIN_NAME.py

how to install site24x7 agent on linux 64bit

DEVICE_KEY="XXX" # A long authentication key from site24x7.com
sudo wget https://staticdownloads.site24x7.com/server/Site24x7_Linux_64bit.install
sudo chmod 755 Site24x7_Linux_64bit.install
sudo ./Site24x7_Linux_64bit.install -i -key=$DEVICE_KEY

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

site24x7-0.4.0.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

site24x7-0.4.0-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page