Giter VIP home page Giter VIP logo

ptero-status's Introduction

Ptero-Status

About

PteroStatus is an easy to setup pterodactyl daemon status project. It will continuously update a discord embed with live stats from your daemons.

Preview

Preview

Installation

Run the following command to install the npm package

npm i pterostatus

Usage

Node:

const Status = require('pterostatus');

const Node = new Status.Node({
    name: 'Node1',
    interval: 15000,
    controller: 'http://91.109.117.42:4000',
    bearer_token: 'Some secure string' //Optional
});

Controller: (Simple)

const Status = require('pterostatus');

const Controller = new Status.Controller(4000, 'en', {
    interval: 15000
});

Controller: (Advanced)

const Status = require('pterostatus');

const Controller = new Status.Controller(4000, 'en', {
    discord: {
        token: 'BOT-TOKEN',
        channel: 'CHANNEL-ID',
    },
    pterodactyl: {
        panel: 'https://panel.domain.com',
        apiKey: 'API-KEY'
    },
    telegram: {
        tgtoken: 'Telegram Bot Token by @BotFather',
        tgchatID: 'Chat ID'
    },
    notifications: {
        discord: 'https://discord.com/api/webhooks/881362307375067136/zAdAgNEdQ-h3agBh-uCYPBHu47RUWMe_JpBJCUkEelx5oDgIDX_hGi-1_xRT2j6DWZej',
        webhook: 'http://0.0.0.0:5000/webhook'
    },
    node: {
        message: '**{node.name}**: [Memory: {node.memory.used}/{node.memory.total}] [Disk: {node.disk.used}/{node.disk.total}]',
        online: '🟒 **ONLINE**',
        offline: 'πŸ”΄ **OFFLINE**'
    },
    embed: {
        color: '#06cce2',
        title: 'Node Status',
        description: '**Nodes**:\n{nodes.list}\n\n**Total**:\nMemory: {memory.used}/{memory.total}\nDisk: {disk.used}/{disk.total}\n\n**Pterodactyl:**\nUsers: {pterodactyl.users}\nServers: {pterodactyl.servers}',
        footer: {
            text: 'Last updated: {lastupdated}',
            icon: 'https://i.imgur.com/9b1qwml.jpg'
        }
    },
    interval: 15000,
    bearer_token: 'Some secure string' //Optional
});

Events

Controller.on('online', (node) => {
    console.log(`Node: "${node.nodeName}" has come back online!`);
});

Controller.on('offline', (node) => {
    console.log(`Node: "${node.nodeName}" has gone offline!`);
});

Pterodactyl Application API Key

You need to have pterodactyl panel installed in order to use PteroStatus' pterodactyl integration. Not all permissions are required on the api key. Please just give the following permissions to the api key Permissions

Placeholders:

NODE:
{node.name} - Node's name
{node.memory.used} - Total node's memory
{node.memory.total} - Total used memory
{node.disk.used} - Total used disk
{node.disk.total} - Total node's disk
{node.cpu.used} - Total used cpu
{node.cpu.cores} - Total cpu cores
{node.cpu} - Displays the cpu model
{node.os} - Displays the os
{node.status} - Shows if it's online or offline

NODES:
{nodes.online} - Number of online nodes
{nodes.offline} - Number of offline nodes
{nodes.list} - List of nodes along with their statuses
{nodes.total} - Number of total nodes

TOTAL:
{memory.total} - Total memory
{disk.total} - Total disk
{cores.total} - Total cores

USED:
{memory.used} - Total memory used by nodes
{disk.used} - Total disk used by nodes
{memory.used%} - Total memory percentage used by nodes
{disk.used%} - Total disk percentage used by nodes

PTERODACTYL:
{pterodactyl.users} - Number of current panel users
{pterodactyl.servers} - Number of current panel servers

Language:

The currently supported languages ​​are English(en) and German(de)

Bearer Authentication:

The option bearer_token can be set in the DAEMON and CONTROLLER, it will make sure that only your nodes can communicate with eatch other.
If you are using this it is recommended to use HTTPS for extra security.

Support

Need some help setting up Ptero-Status? Join BlueFox Development's Discord

https://discord.gg/KHbBfWSdnZ

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.