Download Server Monitor(cqt-window)/src/core/Platform.h from mchuca/ServerMonitor: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/mchuca/ServerMonitor/resolve/main/Server%20Monitor(cqt-window)/src/core/Platform.h
- Command line
-
hf download 'hf://mchuca/ServerMonitor/Server Monitor(cqt-window)/src/core/Platform.h'
-
curl -L -o Platform.h 'https://huggingface.co/mchuca/ServerMonitor/resolve/main/Server%20Monitor(cqt-window)/src/core/Platform.h'
1.77 kB
| // Everything that depends on the operating system of the monitored machines: how to start a shell, the | |
| // collector script with its parser (MetricsEngine::process), and the control commands. Linux and Windows | |
| // editions differ only in Platform.cpp. | |
| struct Def { QString key, label, unit; }; // rule metric / action catalogue | |
| struct Cmd { QString label, cmd; bool danger = false, confirm = true, button = true; }; // cmd: %1 = pid or quoted name | |
| namespace P { | |
| extern const char *const prioLabel, *const kernelPrefix, *const sshHint, *const cleanup; // cleanup: default disk cleanup command | |
| extern const bool sudo, posixCpu; // "sudo -n" exists; CPU time has I/O wait + steal | |
| extern const int interval, normalPrio; // default sample interval (s); priority value of an ordinary process | |
| QStringList shell(int interval = 0); // argv of a shell that runs a script from stdin (interval > 0: collector arguments) | |
| QByteArray collector(int interval); // stdin for the collector | |
| QByteArray wrap(const QString &cmd, bool sudo); // stdin for a one-shot command | |
| QString quote(QString s); // shell quoting | |
| QString command(const QString &action, const QString &arg); // kill_pid | renice | restart_service | restart_failed | drop_caches | |
| QString serviceLogs(const QString &unit, int lines); | |
| QString power(bool reboot); | |
| bool isProtected(int pid, int ppid, double rss, const QString &name); // never killed automatically, no leak / runaway findings | |
| const QVector<Def> &ruleActions(); // unit = argument hint ("" = none) | |
| const QVector<Cmd> &procActions(), &priorities(), &serviceActions(), &diagnostics(), &systemActions(); | |
| } | |