Porkchop

Logiciel capture d'écran:
Porkchop
Détails logiciels:
Version: 0.7.3
Date de transfert: 15 Apr 15
Développeur: Scott Smith
Licence: Gratuit
Popularité: 2

Rating: nan/5 (Total Votes: 0)

Porkchop est un serveur d'informations du système basé sur HTTP simple écrit en Python. & Nbsp; Vous écrivez des plugins pour lui et il répond avec les données en fonction de votre demande.
Voici un exemple:
scott @ beatbox: ~% http curl: // localhost: 5000 / cpuinfo
/ Cpuinfo / processor2 / FPU oui
/ Cpuinfo / processor2 / f00f_bug pas
/ Cpuinfo / processor2 / cache_alignment 64
/ Cpuinfo / processor2 / vendor_id AuthenticAMD
/ cpuinfo / processor2 / drapeaux fpu
/ Cpuinfo / processor2 / bogomips 6384
/ Cpuinfo / processor2 / hlt_bug pas
/ Cpuinfo / processor2 / apicid 2
/ Cpuinfo / processor2 / fpu_exception oui
/ Cpuinfo / processor2 / marcher 3
/ Cpuinfo / processor2 / wp oui
/ Cpuinfo / processor2 / 4 frères et sœurs
/ Cpuinfo / processor2 / modèle 4
/ Cpuinfo / processor2 / coma_bug pas
/ Cpuinfo / processor2 / fdiv_bug pas
/ Cpuinfo / processor3 / FPU oui
/ Cpuinfo / processor3 / f00f_bug pas
/ Cpuinfo / processor3 / cache_alignment 64
/ Cpuinfo / processor3 / vendor_id AuthenticAMD
/ cpuinfo / processor3 / drapeaux fpu
/ Cpuinfo / processor3 / bogomips 6384
/ Cpuinfo / processor3 / hlt_bug pas
/ Cpuinfo / processor3 / apicid 3
/ Cpuinfo / processor3 / fpu_exception oui
/ Cpuinfo / processor3 / marcher 3
/ Cpuinfo / processor3 / wp oui
/ Cpuinfo / processor3 / 4 frères et sœurs
/ Cpuinfo / processor3 / modèle 4
/ Cpuinfo / processor3 / coma_bug pas
/ Cpuinfo / processor3 / fdiv_bug pas
[Snip]
/ Heure 1311387215
scott @ beatbox: ~%
Il peut également répondre avec JSON via l'extension de fichier .json ou le réglage de la tête Accept: application / json.
scott @ beatbox: ~% http curl: // localhost: 5000 / cpuinfo.json
{"Cpuinfo": {"processor2": {"fpu": "oui", "f00f_bug": "non", "cache_alignment": "64", "vendor_id": "AuthenticAMD", "drapeaux": "fpu" , "bogomips": "6384", "hlt_bug": "non", "apicid": "2", "fpu_exception": "oui", "pas à pas": "3", "WP": "oui", " frères et sœurs ":" "," modèle 4 ":" 4 "," coma_bug ":" non "," fdiv_bug ":" non "}," processor3 ": {" fpu ":" oui "," f00f_bug ":" non »,« cache_alignment ":" 64 "," vendor_id ":" AuthenticAMD "," drapeaux ":" fpu "," Bogomips ":" 6384 "," hlt_bug ":" non "," apicid ":" 3 " , "fpu_exception": "oui", "pas à pas": "3", "wp": "Oui", "frères et sœurs": "4", "modèle": "4", "coma_bug": "non", " fdiv_bug ":" non "}," processor0 ": {" fpu ":" oui "," f00f_bug ":" non "," cache_alignment ":" 64 "," vendor_id ":" AuthenticAMD "," drapeaux ":" fpu "," bogomips ":" 6382 "," hlt_bug ":" non "," apicid ":" 0 "," fpu_exception ":" oui "," pas à pas ":" 3 "," WP ":" oui " , "frères et sœurs": "modèle" "4", "4", "coma_bug": "non", "fdiv_bug": "non"}, "processeur1": {"fpu": "oui", "f00f_bug" : "non", "cache_alignment": "64", "vendor_id": "AuthenticAMD", "drapeaux": "fpu", "Bogomips": "6384", "hlt_bug": "non", "apicid": " 1 "," fpu_exception ":" oui "," pas à pas ":" 3 "," wp ":" Oui "," frères et sœurs ":" 4 "," modèle ":" 4 "," coma_bug ":" non " , "fdiv_bug": "non"}}, "temps": "1311389934"}
scott @ beatbox: ~%
Installation
pip installer porkchop
ou
python setup.py install
Ecrire des plugins
Il est assez facile d'écrire un nouveau plugin. Ils sont juste des modules Python avec quelques attributs communs:
- Un plugin doit sous-classe porkchop.plugin.PorkchopPlugin.
- La classe de Le plugin doit être suffixé avec Plugin. Son nom réel du fichier dans le répertoire du plugin devrait également correspondre au préfixe. Par exemple, FooPlugin serait dans le fichier foo.py
- La classe de Le greffon doit comporter une méthode appelée get_data qui retourne un dictionnaire des informations à afficher.
Par défaut, la méthode de get_data d'un plugin ne sera appelée si les données sont vieux plus de 60 secondes. Ceci peut être changé sur une base per-greffon en fixant self.refresh dans la méthode de ___init___ de la classe.
. Ces plugins peuvent être placés dans ne importe quel répertoire vous choisissez, et chargés en passant l'option -d pour Porkchop

Exigences :

  • Python

D'autres logiciels de développeur Scott Smith

dvdauthor
dvdauthor

28 Sep 15

Decode Reply Tool
Decode Reply Tool

14 Apr 15

Tenderloin
Tenderloin

20 Feb 15

Commentaires à Porkchop

Commentaires non trouvées
Ajouter un commentaire
Tourner sur les images!