Skip to content

NotTK/Oneclick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Oneclick Device Diagnostics

Installation Instructions:

These instructions assume you are the root user. If you are not, prepend sudo to the shell commands or temporarily become a user with root privileges

After logging into your LibreNMS server CLI:

Home dir:
cd ~/

Clone repo to your home dir:
git clone https://github.com/NotTK/Oneclick

Moving Oneclick.blade.php to correct dir:
mv Oneclick/Oneclick.blade.php resources/views/device/tabs/

Moving OneclickController.php to correct dir:
mv Oneclick/OneclickController.php app/Http/Controllers/Device/Tabs/

Edit the DeviceController.php file:
vi app/Http/Controller/DeviceController.php

Using 'vi':
press 'i' to switch to INSERT mode (Typing Mode)
press 'esc' to switch to READ mode
to save file and exit you have to be in READ mode and type ':wq'
to leave file without saving you have to be in READ mode and type ':q'
to force leave file without saving you have to be in READ mode and type ':q!'

One you are editing the DeviceController.php file, find the 'private $tabs',
at the bottom after the 'CaptureController::class,' press ENTER to add a new line
(make sure you are in INSERT mode) and type the following:
'oneclick' => \App\Http\Controllers\Device\Tabs\OneclickController::class,

From there refresh the device page and see the new tab added.

Adding Laravel Route: vi routes/web.php
Add the following code after the "// Device Tabs" comment near line 80

Route::post('/run-python-script', function() {
      try {
          exec('python3 Tester.py', $output, $return_var);

          return response()->json(['output' => $output, 'return_var' => $return_var]);
      } catch (Exception $e) {
          return response()->json(['error' => $e->getMessage()]);
      }
  });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published