First Upload

This commit is contained in:
2024-10-19 18:23:55 +00:00
commit 9db52c11c3
11339 changed files with 1479286 additions and 0 deletions

1
database/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.sqlite*

View File

@@ -0,0 +1,20 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class BannerFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'login_banner' => $faker->sentence,
];
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class CategoryFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'categoryName' => $this->faker->firstName.mt_rand(1000000, 9999999),
'categoryDescription' => $this->faker->sentence,
'badgeColor' => $this->faker->safeColorName,
];
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class CommandFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'command' => $this->faker->name,
'description' => $this->faker->sentence,
];
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class ConfigFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$id = $this->faker->randomNumber(5);
return [
'device_id' => $id,
'device_name' => 'router'.$id,
'device_category' => $this->faker->randomElement(['Switches', 'Routers', 'Firewalls', 'Load Balancers', 'Servers', 'Storage', 'Access Points', 'Wireless', 'Other'], 1),
'command' => $this->faker->randomElement(['show run', 'show clock', 'show version']),
'type' => 'device_download',
'download_status' => $this->faker->randomElement([0, 1, 2]),
'report_id' => 'anEnablePrompt#',
'config_location' => rconfig_appdir_path().'/storage/app/rconfig/data/Routers/router3/2022/Jul/09/showrun_1612.txt',
'config_filename' => 'showrun_922.txt',
'start_time' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
'end_time' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
'duration' => $this->faker->randomDigit,
'created_at' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
'updated_at' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
];
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use App\Models\ConfigVersion;
use Illuminate\Database\Eloquent\Factories\Factory;
class ConfigVersionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = ConfigVersion::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
//
];
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class DeviceFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'device_name' => 'device'.$this->faker->randomNumber($nbDigits = 9),
'device_ip' => $this->faker->ipv4,
'device_default_creds_on' => 0,
'device_username' => $this->faker->userName,
'device_password' => $this->faker->password,
'device_enable_password' => $this->faker->password,
'device_cred_id' => 0,
'device_main_prompt' => 'anEnablePrompt#',
'device_enable_prompt' => 'anEnablePrompt>',
'device_category_id' => 9999,
'device_template' => $this->faker->numberBetween(10, 100),
'device_model' => $this->faker->word,
'device_version' => $this->faker->randomDigit,
'device_added_by' => $this->faker->userName,
'created_at' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
'updated_at' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
'last_seen' => '2020-05-14 11:53:01',
'status' => 1,
];
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class MonitoredScheduledTaskLogItemsFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'task_id' => 444444,
'monitored_scheduled_task_id' => 2,
'type' => 'rconfig:download-device',
'meta' => 'Task finished',
];
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class MonitoredScheduledTasksFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'task_id' => 123123,
'name' => 'DevTask1',
'type' => 'rconfig:download-device',
'cron_expression' => '0 0 * * 0',
'timezone' => null,
'ping_url' => null,
'last_started_at' => '2022-06-27 12:00:08',
'last_finished_at' => '2022-06-27 12:00:08',
'last_failed_at' => null,
'last_skipped_at' => null,
'created_at' => '2022-06-22 22:00:02',
'updated_at' => '2022-06-27 12:00:08',
];
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use Crypt;
use Illuminate\Database\Eloquent\Factories\Factory;
class SettingFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'login_banner' => 'Authorization message - You must be an authorized user to login and use this system.',
'timezone' => 'Europe/Dublin',
'mail_host' => \Config::get('MAIL_HOST', 'smtp.mailtrap.io'),
'mail_port' => \Config::get('MAIL_PORT', 2525),
'mail_from_email' => \Config::get('MAIL_FROM_ADDRESS', 'admin_dev@rconfig.com'),
'mail_to_email' => $this->faker->email,
'mail_authcheck' => \Config::get('MAIL_ENCRYPTION'),
'mail_username' => env('MAIL_USERNAME'),
'mail_password' => Crypt::encrypt(env('MAIL_PASSWORD')),
'mail_driver' => \Config::get('MAIL_DRIVER', 'smtp'),
'mail_encryption' => \Config::get('MAIL_ENCRYPTION', 'tls'),
'defaultDeviceUsername' => $this->faker->userName,
'defaultDevicePassword' => $this->faker->password,
'defaultEnablePassword' => $this->faker->password,
'passwordEncryption' => $this->faker->boolean,
'deviceDebugging' => $this->faker->boolean,
'phpDebugging' => $this->faker->boolean,
];
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class TagFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$siteCode = 'Site-'.$this->faker->countryISOAlpha3.'-'.$this->faker->randomNumber(5);
return [
'tagname' => $siteCode,
'tagDescription' => 'A demo tag for '.$siteCode,
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class TaskFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'task_name' => $this->faker->firstNameMale . $this->faker->numberBetween($min = 100000, $max = 999999),
'task_desc' => $this->faker->sentence,
'task_command' => 'rconfig:download-device',
'task_categories' => $this->faker->boolean,
'task_devices' => $this->faker->boolean,
'task_tags' => $this->faker->boolean,
'task_email_notify' => $this->faker->boolean,
'task_cron' => '0 0 * * 0 ',
'download_report_notify' => $this->faker->boolean,
'verbose_download_report_notify' => $this->faker->boolean,
'is_system' => $this->faker->boolean,
];
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\Factory;
class TaskdownloadreportFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$report_id = $this->faker->uuid;
return [
'report_id' => $report_id,
'task_id' => $this->faker->numberBetween($min = 100000, $max = 999999),
'task_name' => $this->faker->word,
'task_desc' => $this->faker->sentence,
'task_type' => $this->faker->word,
'file_name' => $report_id.'.html',
'start_time' => Carbon::now(),
'end_time' => Carbon::now()->addSeconds(59),
'duration' => $this->faker->randomDigit(),
];
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class TemplateFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'fileName' => $this->faker->firstNameMale,
'templateName' => $this->faker->word,
'description' => $this->faker->sentence,
'created_at' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
'updated_at' => $this->faker->dateTimeThisDecade($max = 'now', $timezone = null),
];
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\TrackedJob>
*/
class TrackedJobFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
'trackable_id' => (string) Str::uuid(),
'trackable_type' => 'App\\Jobs\\DownloadConfigNow',
'queue' => '',
'status' => 'started',
'payload' => '{"uuid":"83244959-f757-43e0-9943-35513efcab0a","timeout":120,"tags":[],"id":"83244959-f757-43e0-9943-35513efcab0a","backoff":null,"pushedAt":"1664009910.4628","displayName":"App\\\\Jobs\\\\DownloadConfigNow","maxTries":5,"job":"Illuminate\\\\Queue\\\\CallQueuedHandler@call","failOnTimeout":false,"data":{"command":"O:26:\\"App\\\\Jobs\\\\DownloadConfigNow\\":2:{s:11:\\"\\u0000*\\u0000username\\";s:5:\\"admin\\";s:12:\\"\\u0000*\\u0000device_id\\";i:1001;}","commandName":"App\\\\Jobs\\\\DownloadConfigNow"},"retryUntil":null,"maxExceptions":null,"type":"job","attempts":4}',
'command' => 'O:26:"App\\Jobs\\DownloadConfigNow":2:{s:11:" * username";s:5:"admin";s:12:" * device_id";i:1001;}',
'device_id' => $this->faker->randomElement([1001, 1002, 1003, 1004]),
'output' => null,
'started_at' => '2022-09-24 09:58:32',
'finished_at' => null,
];
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'username' => $this->faker->username(),
'email' => $this->faker->numberBetween(1000, 9999999) . '@rconfig.com',
'email_verified_at' => now(),
'password' => Hash::make($this->faker->name()), // password
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function unverified()
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class VendorFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'vendorName' => $this->faker->firstNameMale.$this->faker->randomNumber(9),
];
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateActivityLogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activity_log', function (Blueprint $table) {
$table->increments('id');
$table->string('log_name')->nullable()->index();
$table->text('description', 65535);
$table->integer('subject_id')->nullable();
$table->string('subject_type')->nullable();
$table->integer('causer_id')->nullable();
$table->string('causer_type')->nullable();
$table->text('properties', 65535)->nullable();
$table->string('event_type')->nullable();
$table->string('device_name')->nullable();
$table->string('device_id')->nullable();
$table->string('events_ids')->nullable();
$table->string('connection_category')->nullable();
$table->text('connection_ids', 65535)->nullable();
$table->text('class', 65535)->nullable();
$table->text('function', 65535)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('activity_log');
}
}

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function (Blueprint $table) {
$table->increments('id');
$table->string('categoryName', 191)->unique('categoryName');
$table->text('categoryDescription', 65535)->nullable();
$table->string('badgeColor', 50)->nullable();
$table->dateTime('created_at')->nullable();
$table->string('updated_at', 50)->nullable();
});
DB::table('categories')->insert([
0 => [
'id' => '1',
'categoryName' => 'Routers',
'categoryDescription' => null,
'badgeColor' => 'badge-primary',
'created_at' => '2018-06-06 22:20:44',
'updated_at' => null,
],
1 => [
'id' => '2',
'categoryName' => 'Switches',
'categoryDescription' => null,
'badgeColor' => 'bg-danger',
'created_at' => '2018-06-06 22:20:52',
'updated_at' => null,
],
2 => [
'id' => '3',
'categoryName' => 'Firewalls',
'categoryDescription' => null,
'badgeColor' => 'badge-warning',
'created_at' => '2018-06-06 21:21:04',
'updated_at' => null,
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categories');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCategoryCommandTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('category_command', function (Blueprint $table) {
$table->integer('category_id')->nullable();
$table->integer('command_id')->nullable();
});
DB::table('category_command')->insert([
0 => [
'category_id' => '1',
'command_id' => '1',
],
1 => [
'category_id' => '1',
'command_id' => '2',
],
2 => [
'category_id' => '1',
'command_id' => '3',
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('category_command');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCategoryDeviceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('category_device', function (Blueprint $table) {
$table->integer('category_id')->nullable();
$table->integer('device_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('category_device');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCategoryTaskTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('category_task', function (Blueprint $table) {
$table->integer('category_id')->nullable();
$table->integer('task_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('category_task');
}
}

View File

@@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCommandsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('commands', function (Blueprint $table) {
$table->integer('id', true);
$table->string('command', 255);
$table->string('description')->nullable();
$table->timestamps();
});
DB::table('commands')->insert([
0 => [
'id' => '1',
'command' => 'show clock',
'description' => 'An Example command',
'created_at' => '2019-07-16 05:51:44',
'updated_at' => '2019-07-16 05:51:44',
],
1 => [
'id' => '2',
'command' => 'show version',
'description' => 'An Example command',
'created_at' => '2019-07-16 05:51:44',
'updated_at' => '2019-07-16 05:51:44',
],
2 => [
'id' => '3',
'command' => 'show run',
'description' => 'An Example command',
'created_at' => '2019-07-16 05:51:44',
'updated_at' => '2019-07-16 05:51:44',
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('commands');
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateConfigsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('configs', function (Blueprint $table) {
$table->integer('id', true);
$table->integer('device_id')->nullable();
$table->string('device_name')->nullable();
$table->string('device_category')->nullable();
$table->string('command')->nullable();
$table->string('type')->nullable();
$table->integer('download_status')->nullable();
$table->string('report_id')->nullable();
$table->string('config_location')->nullable();
$table->string('config_filename')->nullable();
$table->dateTime('start_time')->nullable();
$table->dateTime('end_time')->nullable();
$table->integer('duration')->nullable();
$table->dateTime('created_at')->nullable();
$table->dateTime('updated_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('configs');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDeviceTagTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('device_tag', function (Blueprint $table) {
$table->integer('device_id')->nullable();
$table->integer('tag_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('device_tag');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDeviceTaskTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('device_task', function (Blueprint $table) {
$table->integer('device_id')->nullable();
$table->integer('task_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('device_task');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDeviceTemplateTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('device_template', function (Blueprint $table) {
$table->integer('device_id')->nullable();
$table->integer('template_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('device_template');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDeviceVendorTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('device_vendor', function (Blueprint $table) {
$table->integer('device_id')->nullable();
$table->integer('vendor_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('device_vendor');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateDevicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('devices', function (Blueprint $table) {
$table->integer('id', true);
$table->string('device_name', 191)->nullable();
$table->string('device_ip', 191)->nullable();
$table->integer('device_default_creds_on')->nullable();
$table->string('device_username', 191)->nullable();
$table->string('device_password')->nullable();
$table->string('device_enable_password')->nullable();
$table->string('device_main_prompt')->nullable();
$table->string('device_enable_prompt', 191)->nullable();
$table->integer('device_category_id')->nullable();
$table->integer('device_template')->nullable();
$table->string('device_model', 191)->nullable();
$table->string('device_version', 191)->nullable();
$table->string('device_added_by', 191)->nullable()->default('-');
$table->timestamps();
$table->integer('status')->nullable()->default(1);
$table->timestamp('last_seen')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('devices');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigInteger('id', true)->unsigned();
$table->string('queue')->index();
$table->text('payload', 65535);
$table->boolean('attempts');
$table->integer('reserved_at')->unsigned()->nullable();
$table->integer('available_at')->unsigned();
$table->integer('created_at')->unsigned();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('jobs');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@@ -0,0 +1,70 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings', function (Blueprint $table) {
$table->integer('id', true);
$table->text('login_banner', 65535)->nullable();
$table->string('timezone')->nullable();
$table->string('mail_host')->nullable();
$table->integer('mail_port')->nullable();
$table->string('mail_from_email')->nullable();
$table->text('mail_to_email', 65535)->nullable();
$table->integer('mail_authcheck')->nullable();
$table->string('mail_username')->nullable();
$table->string('mail_password', 512)->nullable();
$table->string('mail_driver')->nullable();
$table->string('mail_encryption')->nullable();
$table->string('defaultDeviceUsername')->nullable();
$table->string('defaultDevicePassword')->nullable();
$table->string('defaultEnablePassword', 512)->nullable();
$table->integer('passwordEncryption')->nullable()->default(0)->comment('0 - no encryption, 1 = encryption');
$table->integer('deviceDebugging')->nullable();
$table->integer('phpDebugging')->nullable();
$table->timestamps();
});
DB::table('settings')->insert([
'id' => '1',
'login_banner' => 'Authorization message - You must be an authorized user to login and use this system.',
'timezone' => 'Europe/Dublin',
'mail_host' => 'devmailer.rconfig.com',
'mail_port' => 1025,
'mail_from_email' => 'admin@domain.com',
'mail_to_email' => 'user@domain.com',
'mail_authcheck' => '0',
'mail_username' => null,
'mail_password' => null,
'mail_driver' => 'smtp',
'mail_encryption' => null,
'defaultDeviceUsername' => null,
'defaultDevicePassword' => null,
'defaultEnablePassword' => null,
'passwordEncryption' => '1',
'deviceDebugging' => '0',
'phpDebugging' => '1',
'created_at' => '2019-07-15 18:38:03',
'updated_at' => '2019-07-15 18:38:23',
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('settings');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagTaskTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tag_task', function (Blueprint $table) {
$table->integer('task_id')->nullable();
$table->integer('tag_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tag_task');
}
}

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tags', function (Blueprint $table) {
$table->integer('id', true);
$table->string('tagname', 50);
$table->string('tagDescription')->nullable();
$table->timestamps();
});
DB::table('tags')->insert([
0 => [
'id' => '1',
'tagname' => 'Routers',
'tagDescription' => 'A Tag for Routers',
'created_at' => '2019-07-16 05:51:44',
'updated_at' => '2019-07-16 05:51:44',
],
1 => [
'id' => '2',
'tagname' => 'Switches',
'tagDescription' => 'A Tag for Switches',
'created_at' => '2019-07-16 05:51:44',
'updated_at' => '2019-07-16 05:51:44',
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tags');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTaskdownloadreportsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('taskdownloadreports', function (Blueprint $table) {
$table->integer('id', true);
$table->string('report_id', 50)->nullable();
$table->integer('task_id');
$table->string('task_name')->nullable();
$table->string('task_desc')->nullable();
$table->string('task_type')->default('');
$table->string('file_name')->nullable();
$table->timestamp('start_time')->nullable();
$table->timestamp('end_time')->nullable();
$table->bigInteger('duration')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('taskdownloadreports');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTasksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tasks', function (Blueprint $table) {
$table->integer('id', true);
$table->string('task_name')->nullable();
$table->string('task_desc')->nullable();
$table->string('task_command')->nullable();
$table->integer('task_categories')->nullable();
$table->integer('task_devices')->nullable();
$table->integer('task_tags')->nullable();
$table->integer('task_snippet')->nullable();
$table->string('task_cron')->nullable();
$table->integer('task_email_notify')->nullable();
$table->integer('download_report_notify')->nullable();
$table->integer('verbose_download_report_notify')->nullable();
$table->integer('is_system')->nullable()->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tasks');
}
}

View File

@@ -0,0 +1,69 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTemplatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('templates', function (Blueprint $table) {
$table->integer('id', true);
$table->string('fileName', 191)->nullable();
$table->string('templateName', 191)->nullable();
$table->string('description', 191)->nullable();
$table->timestamps();
});
DB::table('templates')->insert([
0 => [
'id' => '1',
'fileName' => '/app/rconfig/templates/ios-telnet-noenable.yml',
'templateName' => 'Cisco IOS - TELNET - No Enable',
'description' => 'Cisco IOS TELNET based connection without enable mode',
'created_at' => '2018-02-27 12:09:44',
'updated_at' => null,
],
1 => [
'id' => '2',
'fileName' => '/app/rconfig/templates/ios-telnet-enable.yml',
'templateName' => 'Cisco IOS - TELNET - Enable',
'description' => 'Cisco IOS TELNET based connection with enable mode',
'created_at' => '2018-02-27 12:09:44',
'updated_at' => null,
],
2 => [
'id' => '3',
'fileName' => '/app/rconfig/templates/ios-ssh-noenable.yml',
'templateName' => 'Cisco IOS - SSH - No Enable',
'description' => 'Cisco IOS SSH based connection without enable mode',
'created_at' => '2018-02-27 12:09:44',
'updated_at' => null,
],
3 => [
'id' => '4',
'fileName' => '/app/rconfig/templates/ios-ssh-enable.yml',
'templateName' => 'Cisco IOS - SSH - Enable',
'description' => 'Cisco IOS SSH based connection with enable mode',
'created_at' => '2018-02-27 12:09:44',
'updated_at' => null,
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('templates');
}
}

View File

@@ -0,0 +1,53 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->dateTime('email_verified_at')->nullable();
$table->string('password');
$table->string('remember_token', 100)->nullable();
$table->string('role', 50)->nullable()->comment('0 = user, 1 = admin');
$table->timestamps();
$table->text('settings', 65535)->nullable();
});
DB::table('users')->insert([
0 => [
'id' => '1',
'name' => 'admin',
'email' => 'admin@domain.com',
'email_verified_at' => null,
'password' => '$2y$10$ZF3AXzM/N/xduWF0CQiswOaHYh6EwiNcWJ8AUp.7xv0qDcfLvVsGi',
'remember_token' => null,
'role' => 'Admin',
'created_at' => '2019-07-15 14:25:26',
'updated_at' => '2019-07-15 14:25:26',
'settings' => '{"devices_view":"display1"}',
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@@ -0,0 +1,69 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateVendorsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vendors', function (Blueprint $table) {
$table->increments('id');
$table->string('vendorName', 191);
$table->timestamps();
});
DB::table('vendors')->insert([
0 => [
'vendorName' => 'Aruba',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
1 => [
'vendorName' => 'Brocade',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
2 => [
'vendorName' => 'Checkpoint',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
3 => [
'vendorName' => 'Cisco',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
4 => [
'vendorName' => 'Dell',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
5 => [
'vendorName' => 'Extreme',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
6 => [
'vendorName' => 'Fortinet',
'created_at' => '2018-06-07 13:42:08',
'updated_at' => '2018-06-07 13:42:08',
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('vendors');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSessionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->unique();
$table->unsignedBigInteger('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');
$table->integer('last_activity');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sessions');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ChangeDevicesPasswordsFieldTypesToText extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('devices', function (Blueprint $table) {
$table->text('device_password')->nullable()->change();
$table->text('device_enable_password')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('devices', function (Blueprint $table) {
//
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddLastLoginFieldToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->timestamp('last_login')->nullable()->after('role');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('last_login');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateRoleFieldDefaultValue extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('role')->default('Admin')->comment(null)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->string('role')->default('Admin')->change();
});
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateActivityLogArchivesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activity_log_archives', function (Blueprint $table) {
$table->increments('id');
$table->integer('original_id')->unsigned()->index();
$table->string('log_name')->nullable()->index();
$table->text('description', 65535);
$table->integer('subject_id')->nullable();
$table->string('subject_type')->nullable();
$table->integer('causer_id')->nullable();
$table->string('causer_type')->nullable();
$table->text('properties', 65535)->nullable();
$table->string('event_type')->nullable();
$table->string('device_name')->nullable();
$table->string('device_id')->nullable();
$table->string('events_ids')->nullable();
$table->string('connection_category')->nullable();
$table->text('connection_ids', 65535)->nullable();
$table->text('class', 65535)->nullable();
$table->text('function', 65535)->nullable();
$table->timestamp('original_created_at')->nullable();
$table->timestamp('original_updated_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('activity_log_archives');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFilesizeToConfigs extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('configs', function (Blueprint $table) {
$table->bigInteger('config_filesize')->after('config_filename')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('configs', function (Blueprint $table) {
$table->dropColumn('config_filesize');
});
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJobBatchesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->text('failed_job_ids');
$table->text('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('job_batches');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSshKeyFieldToDevicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('devices', function (Blueprint $table) {
$table->string('ssh_key_id')->nullable()->after('device_enable_password');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('devices', function (Blueprint $table) {
$table->dropColumn('ssh_key_id');
});
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateDefaultPasswordsFieldType extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->text('defaultDevicePassword')->change();
$table->text('defaultEnablePassword')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->string('defaultDevicePassword')->change();
$table->string('defaultEnablePassword')->change();
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateMailPasswordFieldType extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->text('mail_password')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->string('mail_password')->change();
});
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Spatie\Health\ResultStores\EloquentHealthResultStore;
return new class extends Migration
{
public function up()
{
$tableName = EloquentHealthResultStore::getHistoryItemInstance()->getTable();
Schema::create($tableName, function (Blueprint $table) {
$table->id();
$table->string('check_name');
$table->string('check_label');
$table->string('status');
$table->text('notification_message')->nullable();
$table->string('short_summary')->nullable();
$table->json('meta');
$table->timestamp('ended_at');
$table->uuid('batch');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$tableName = EloquentHealthResultStore::getHistoryItemInstance()->getTable();
Schema::dropIfExists($tableName);
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddBatchUuidColumnToActivityLogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('activity_log', function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
Schema::table('activity_log_archives', function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('activity_log', function (Blueprint $table) {
$table->dropColumn('batch_uuid');
});
Schema::table('activity_log_archives', function (Blueprint $table) {
$table->dropColumn('batch_uuid');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ChangeSettingsMailHostDefaultValue extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->string('mail_host')->default('default')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->string('mail_host')->nullable()->change();
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIndexesToConfigsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('configs', function (Blueprint $table) {
$table->index(['device_id', 'device_name', 'command', 'report_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('configs', function (Blueprint $table) {
$table->dropIndex(['device_id', 'device_name', 'command', 'report_id']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIndexesToDevicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('devices', function (Blueprint $table) {
$table->index(['device_name']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('devices', function (Blueprint $table) {
$table->dropIndex(['device_name']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddDeviceCredIdFieldToDevicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('devices', function (Blueprint $table) {
$table->integer('device_cred_id')->after('device_default_creds_on')->nullable()->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('devices', function (Blueprint $table) {
$table->dropColumn('device_cred_id');
});
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateScheduleMonitorTables extends Migration
{
public function up()
{
Schema::create('monitored_scheduled_tasks', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('task_id');
$table->string('name');
$table->string('type')->nullable();
$table->string('cron_expression');
$table->string('timezone')->nullable();
$table->string('ping_url')->nullable();
$table->dateTime('last_started_at')->nullable();
$table->dateTime('last_finished_at')->nullable();
$table->dateTime('last_failed_at')->nullable();
$table->dateTime('last_skipped_at')->nullable();
$table->timestamps();
});
Schema::create('monitored_scheduled_task_log_items', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('task_id');
$table->unsignedBigInteger('monitored_scheduled_task_id');
$table
->foreign('monitored_scheduled_task_id', 'fk_scheduled_task_id')
->references('id')
->on('monitored_scheduled_tasks')
->cascadeOnDelete();
$table->string('type');
$table->json('meta')->nullable();
$table->timestamps();
});
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTrackedJobsTable extends Migration
{
public function up()
{
Schema::create('tracked_jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('trackable_id')->index();
$table->string('trackable_type')->index();
$table->string('queue')->nullable();
$table->string('status')->default('queued');
$table->longText('payload')->nullable();
$table->longText('command')->nullable();
$table->integer('device_id')->nullable();
$table->longText('output')->nullable();
$table->timestamp('started_at')->nullable();
$table->timestamp('finished_at')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('tracked_jobs');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUsernameFieldToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('username')->after('name')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('devices', function (Blueprint $table) {
$table->dropColumn('username');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('monitored_scheduled_task_log_items', function (Blueprint $table) {
$table->string('meta', 255)->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('monitored_scheduled_task_log_items', function (Blueprint $table) {
$table->json('meta')->nullable();
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('devices', function (Blueprint $table) {
$table->string('device_port_override')->nullable()->after('device_ip');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('devices', function (Blueprint $table) {
$table->dropColumn('device_port_override');
});
}
};

View File

@@ -0,0 +1,40 @@
<?php
namespace Database\Seeders;
use Database\Seeders\demodata\DemoCategorySeeder;
use Database\Seeders\demodata\DemoCommandSeeder;
use Database\Seeders\demodata\DemoDeviceSeeder;
use Database\Seeders\demodata\DemoTagSeeder;
use Database\Seeders\demodata\DemoTaskReportSeeder;
use Database\Seeders\demodata\DemoTaskSeeder;
use Database\Seeders\demodata\DemoTemplateSeeder;
use Database\Seeders\demodata\DemoUserSeeder;
use Illuminate\Database\Seeder;
// php artisan migrate:fresh && php artisan db:seed --class=DemodataDatabaseSeeder
class DemodataDatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call([
DemoUserSeeder::class,
DemoTagSeeder::class,
DemoCommandSeeder::class,
DemoCategorySeeder::class,
DemoTemplateSeeder::class,
DemoDeviceSeeder::class,
DemoTaskSeeder::class,
DemoTaskReportSeeder::class,
]);
}
}
// TODO
// ACTIVITY LOGS
// REMOVE BACKUPS

View File

@@ -0,0 +1,25 @@
<?php
namespace Database\Seeders;
use Database\Seeders\testdata\DeviceTableSeeder;
use Database\Seeders\testdata\HealthCheckResultsSeeder;
use Database\Seeders\testdata\MikrotikDeviceSeeder;
use Illuminate\Database\Seeder;
class TestdataDatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call([
DeviceTableSeeder::class,
HealthCheckResultsSeeder::class,
MikrotikDeviceSeeder::class,
]);
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Category;
use Illuminate\Database\Seeder;
class DemoCategorySeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Category::create(
[
'id' => 60,
'categoryName' => 'Mikrotiks',
'categoryDescription' => 'A demo category for Mikrotiks',
],
);
Category::create(
[
'categoryName' => 'VPN-Devices',
'categoryDescription' => 'A demo category for VPN-Devices',
]
);
Category::create(
[
'categoryName' => 'Wireless',
'categoryDescription' => 'A demo category for Wireless Devices',
]
);
Category::where('categoryName', 'Firewalls')->update(['categoryDescription' => 'A demo category for Firewall Devices']);
Category::where('categoryName', 'Switches')->update(['categoryDescription' => 'A demo category for Switches']);
Category::where('categoryName', 'Routers')->update(['categoryDescription' => 'A demo category for Routers']);
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Command;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DemoCommandSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$mikExportId = Command::create(
[
'command' => 'export configuration',
'description' => 'export for mikrotiks',
],
);
$mikIntId = Command::create(
[
'command' => 'interface print',
'description' => 'interface print for mikrotiks',
]
);
Command::create(
[
"id" => 6001,
"command" => "Show ip route",
"description" => "Show ip route",
"created_at" => "2023-03-11 08:45:53",
"updated_at" => "2023-03-11 08:45:53",
]
);
Command::where('command', 'show run')->update(['description' => 'A demo command for multiple categories']);
Command::where('command', 'show version')->update(['description' => 'A demo command for multiple categories']);
Command::where('command', 'show clock')->update(['description' => 'A demo command for multiple categories']);
Command::where('command', 'show ip route')->update(['description' => 'A demo command for multiple categories']);
DB::table('category_command')->insert(
[
'command_id' => 1,
'category_id' => 2,
],
);
DB::table('category_command')->insert(
[
'command_id' => 2,
'category_id' => 2,
],
);
DB::table('category_command')->insert(
[
'command_id' => 3,
'category_id' => 2,
]
);
DB::table('category_command')->insert(
[
'command_id' => $mikExportId->id,
'category_id' => 60,
]
);
DB::table('category_command')->insert(
[
'command_id' => $mikIntId->id,
'category_id' => 60,
]
);
}
}

View File

@@ -0,0 +1,373 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Config;
use App\Models\Device;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Spatie\Activitylog\Models\Activity;
class DemoDeviceSeeder extends Seeder
{
protected $faker;
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->faker = \Faker\Factory::create();
// create an array from 1 - 25
$d = 1;
$devices = [];
for ($d = 1; $d < 26; $d++) {
// echo "Device $d\n";
$devices[$d]['id'] = $d;
$devices[$d]['deviceid'] = 5000 . $d;
$devices[$d]['device_name'] = 'router' . $d;
$devices[$d]['deviceip'] = '192.168.50.' . $d . '0';
$devices[$d]['device_password'] = 'cisco';
$devices[$d]['device_category_id'] = 1;
$devices[$d]['templateid'] = 1;
$devices[$d]['vendorid'] = 1;
$devices[$d]['tagid'] = 1;
$devices[$d]['status'] = 1;
$devices[$d]['datecreated'] = $this->faker->dateTimeBetween('-1 years', 'now');
$devices[$d]['lastseen'] = $this->faker->dateTimeBetween('-6 months', 'now');
}
$this->create_the_devices($devices);
}
public function create_the_devices($devices)
{
$configFiles = ['showclock_1609.txt', 'showversion_1609.txt', 'showrun_1609.txt', 'Showiproute_846.txt'];
foreach ($devices as $device) {
$downloadstatus = 1;
if (in_array($device['id'], [4, 12, 16, 20, 22])) {
$device['device_password'] = 'aBadPassword'; // false ip
$device['status'] = 0;
$downloadstatus = 0;
}
Device::create([
'id' => $device['deviceid'],
'device_name' => $device['device_name'],
'device_ip' => $device['deviceip'],
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => $device['device_password'],
'device_enable_password' => 'cisco',
'ssh_key_id' => null,
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => $device['device_category_id'],
'device_template' => $device['templateid'],
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => '1',
'created_at' => $device['datecreated'],
'updated_at' => $device['datecreated'],
'status' => $device['status'],
'last_seen' => $device['lastseen'],
]);
DB::table('device_template')->insert(
[
'device_id' => $device['deviceid'],
'template_id' => $device['templateid'],
],
);
DB::table('category_device')->insert(
[
'category_id' => $device['device_category_id'],
'device_id' => $device['deviceid'],
],
);
DB::table('device_vendor')->insert(
[
'vendor_id' => $device['vendorid'],
'device_id' => $device['deviceid'],
],
);
DB::table('device_tag')->insert(
[
'tag_id' => $device['tagid'],
'device_id' => $device['deviceid'],
],
);
DB::table('device_tag')->insert(
[
'tag_id' => $this->faker->randomElement([4, 5, 6]),
'device_id' => $device['deviceid'],
],
);
for ($j = 0; $j < $this->faker->numberBetween(50, 100); $j++) {
$datetime = $this->faker->dateTimeBetween('-' . $j . ' weeks', '-' . $j - 1 . ' weeks');
foreach ($this->activity_log($device['deviceid'], $device['device_name'], $datetime) as $log) {
Activity::insert([$log]);
}
foreach ($this->configs($device['deviceid'], $device['device_name'], $datetime, $configFiles, $downloadstatus) as $config) {
Config::insert([$config]);
}
}
foreach ($configFiles as $configFile) {
if (!File::exists(config_data_path() . $configFile)) {
File::copy(rconfig_appdir_path() . '/database/seeders/demodata/democonfigs/' . $configFile, config_data_path() . $configFile);
}
}
}
}
public function configs($deviceid, $device_name, $datetime, $configFiles, $downloadstatus = 1)
{
if ($downloadstatus === 0) {
$configFiles = [];
}
return [
[
'device_id' => $deviceid,
'device_name' => $device_name,
'device_category' => 'Routers',
'command' => 'show clock',
'type' => 'device_download',
'download_status' => 2,
'report_id' => null,
'config_location' => !empty($configFiles) ? config_data_path() . $configFiles[0] : null,
'config_filename' => 'showclock_1609.txt',
'config_filesize' => 33,
'start_time' => $datetime,
'end_time' => $datetime,
'duration' => 1,
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'device_id' => $deviceid,
'device_name' => $device_name,
'device_category' => 'Routers',
'command' => 'show version',
'type' => 'device_download',
'download_status' => 1,
'report_id' => null,
'config_location' => !empty($configFiles) ? config_data_path() . $configFiles[1] : null,
'config_filename' => 'showversion_1609.txt',
'config_filesize' => 2353,
'start_time' => $datetime,
'end_time' => $datetime,
'duration' => 1,
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'device_id' => $deviceid,
'device_name' => $device_name,
'device_category' => 'Routers',
'command' => 'show run',
'type' => 'device_download',
'download_status' => 1,
'report_id' => null,
'config_location' => !empty($configFiles) ? config_data_path() . $configFiles[2] : null,
'config_filename' => 'showrun_1609.txt',
'config_filesize' => 6129,
'start_time' => $datetime,
'end_time' => $datetime,
'duration' => 1,
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'device_id' => $deviceid,
'device_name' => $device_name,
'device_category' => 'Routers',
'command' => 'show ip route',
'type' => 'device_download',
'download_status' => 1,
'report_id' => null,
'config_location' => !empty($configFiles) ? config_data_path() . $configFiles[3] : null,
'config_filename' => 'Showiproute_846.txt',
'config_filesize' => 2405,
'start_time' => $datetime,
'end_time' => $datetime,
'duration' => 1,
'created_at' => $datetime,
'updated_at' => $datetime,
],
];
}
public function activity_log($deviceid, $device_name, $datetime)
{
return [
[
'log_name' => 'info',
'description' => 'Manual config download job completed for Device ID:' . $deviceid,
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'config',
'device_name' => null,
'device_id' => null,
'events_ids' => null,
'connection_category' => null,
'connection_ids' => 'N;',
'class' => 'App\\Jobs\\DownloadConfigNow',
'function' => 'handle',
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'log_name' => 'info',
'description' => 'CLI Download ended for rconfig:download-device IDs:' . $deviceid,
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => '',
'device_id' => '',
'events_ids' => null,
'connection_category' => 'rconfig:download-device',
'connection_ids' => 'a:1:{i:0;s:5:"' . $deviceid . '";}',
'class' => 'App\\Console\\Commands\\rconfigDeviceDownload',
'function' => 'handle',
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'log_name' => 'info',
'description' => 'Config downloaded for ' . $device_name . ' with command: "show run" was successful',
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => $device_name,
'device_id' => $deviceid,
'events_ids' => null,
'connection_category' => 'device',
'connection_ids' => 'N;',
'class' => 'Illuminate\\Console\\Command',
'function' => 'handle',
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'log_name' => 'info',
'description' => 'Config downloaded for ' . $device_name . ' with command: "show version" was successful',
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => $device_name,
'device_id' => $deviceid,
'events_ids' => null,
'connection_category' => 'device',
'connection_ids' => 'N;',
'class' => 'Illuminate\\Console\\Command',
'function' => 'handle',
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'log_name' => 'info',
'description' => 'Config downloaded for ' . $device_name . ' with command: "show clock" was successful',
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => $device_name,
'device_id' => $deviceid,
'events_ids' => null,
'connection_category' => 'device',
'connection_ids' => 'N;',
'class' => 'Illuminate\\Console\\Command',
'function' => 'handle',
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'log_name' => 'info',
'description' => 'End device download for ' . $device_name . ' ID:' . $deviceid,
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => $device_name,
'device_id' => $deviceid,
'events_ids' => null,
'connection_category' => 'rconfig:download-device',
'connection_ids' => 'i:;' . $deviceid,
'class' => 'Illuminate\\Console\\Command',
'function' => 'handle',
'created_at' => $datetime,
'updated_at' => $datetime,
],
[
'log_name' => 'info',
'description' => 'Start device download for ' . $device_name . ' ID:' . $deviceid,
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => $device_name,
'device_id' => $deviceid,
'events_ids' => null,
'connection_category' => 'rconfig:download-device',
'connection_ids' => 'i:;' . $deviceid,
'class' => 'Illuminate\\Console\\Command',
'function' => 'handle',
'created_at' => '2022-04-18 15:55:38',
'updated_at' => '2022-04-18 15:55:38',
],
[
'log_name' => 'info',
'description' => 'CLI Download Started for rconfig:download-deviceIDs:' . $deviceid,
'subject_id' => null,
'subject_type' => null,
'causer_id' => null,
'causer_type' => null,
'properties' => '[]',
'batch_uuid' => null,
'event_type' => 'connection',
'device_name' => '',
'device_id' => '',
'events_ids' => null,
'connection_category' => 'rconfig:download-device',
'connection_ids' => 'a:1:{i:0;s:5:"' . $deviceid . ';}',
'class' => 'App\\Console\\Commands\\rconfigDeviceDownload',
'function' => 'handle',
'created_at' => '2022-04-18 15:55:38',
'updated_at' => '2022-04-18 15:55:38',
],
];
}
} // END CLASS

View File

@@ -0,0 +1,35 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Tag;
use Illuminate\Database\Seeder;
class DemoTagSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Tag::create(
[
'tagname' => 'Firewalls',
'tagDescription' => 'A demo tag for Firewalls',
],
[
'tagname' => 'Load Balancers',
'tagDescription' => 'A demo tag for Load Balancers',
],
[
'tagname' => 'Wireless',
'tagDescription' => 'A demo tag for Wireless Devices',
]
);
Tag::factory()
->count(5)
->create();
}
}

View File

@@ -0,0 +1,86 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Taskdownloadreport;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
class DemoTaskReportSeeder extends Seeder
{
protected $faker;
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->faker = \Faker\Factory::create();
$d = 1;
$reports = [];
for ($d = 1; $d < 26; $d++) {
$uuid = $this->faker->uuid();
$datetime = $this->faker->dateTimeBetween('-'.$d.' weeks', '-'.$d - 1 .' weeks');
$task = [];
if ($d % 2 == 0) {
$task = [
'task_id' => 836229,
'task_name' => 'Download core devices',
'task_desc' => 'Download core devices configs once per day',
'file_name' => '836229.html',
];
} else {
$task = [
'task_id' => 618485,
'task_name' => 'Download Routers',
'task_desc' => 'Download Routers Category once a week',
'file_name' => '618485.html',
];
}
$reports[$d]['id'] = $d;
$reports[$d]['report_id'] = $uuid;
$reports[$d]['task_id'] = $task['task_id'];
$reports[$d]['task_name'] = $task['task_name'];
$reports[$d]['task_desc'] = $task['task_desc'];
$reports[$d]['file_name'] = $task['file_name'];
$reports[$d]['start_time'] = $datetime;
$reports[$d]['end_time'] = $datetime;
$reports[$d]['created_at'] = $datetime;
$reports[$d]['updated_at'] = $datetime;
}
foreach ($reports as $report) {
Taskdownloadreport::create(
[
'id' => $report['id'],
'report_id' => $report['report_id'],
'task_id' => $report['task_id'],
'task_name' => $report['task_name'],
'task_desc' => $report['task_desc'],
'task_type' => 'Task Download Report',
'file_name' => $report['file_name'],
'start_time' => $report['start_time'],
'end_time' => $report['end_time'],
'duration' => 57,
'created_at' => $report['created_at'],
'updated_at' => $report['updated_at'],
]
);
if ($report['task_id'] === 836229) {
File::copy(rconfig_appdir_path().'/database/seeders/demodata/demoreports/836229.html', report_path().$report['report_id'].'.html');
}
if ($report['task_id'] === 618485) {
File::copy(rconfig_appdir_path().'/database/seeders/demodata/demoreports/618485.html', report_path().$report['report_id'].'.html');
}
}
// if (!File::exists(report_path() . '836229.html')) {
// File::copy(rconfig_appdir_path() . '/database/seeders/demodata/demoreports/836229.html', report_path() . '836229.html');
// }
}
}

View File

@@ -0,0 +1,76 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Task;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DemoTaskSeeder extends Seeder
{
protected $faker;
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->faker = \Faker\Factory::create();
Task::insert([
'id' => 618485,
'task_name' => 'Download Routers',
'task_desc' => 'Download Routers Category once a week',
'task_command' => 'rconfig:download-category',
'task_categories' => 1,
'task_devices' => 0,
'task_tags' => 0,
'task_cron' => '0 0 * * 0 ',
'task_email_notify' => 1,
'download_report_notify' => 1,
'verbose_download_report_notify' => 1,
'is_system' => 0,
'created_at' => $this->faker->dateTimeBetween('-6 months', 'now'),
'updated_at' => $this->faker->dateTimeBetween('-6 months', 'now'),
]);
Task::insert([
'id' => 836229,
'task_name' => 'Download core devices',
'task_desc' => 'Download core devices configs once per day',
'task_command' => 'rconfig:download-device',
'task_categories' => 0,
'task_devices' => 1,
'task_tags' => 0,
'task_cron' => '0 0 1 1 * ',
'task_email_notify' => 1,
'download_report_notify' => 1,
'verbose_download_report_notify' => 1,
'is_system' => 0,
'created_at' => $this->faker->dateTimeBetween('-6 months', 'now'),
'updated_at' => $this->faker->dateTimeBetween('-6 months', 'now'),
]);
DB::table('device_task')->insert([
'device_id' => 50001,
'task_id' => 836229,
]);
DB::table('device_task')->insert([
'device_id' => 500010,
'task_id' => 836229,
]);
DB::table('device_task')->insert([
'device_id' => 500011,
'task_id' => 836229,
]);
DB::table('device_task')->insert([
'device_id' => 500012,
'task_id' => 836229,
]);
DB::table('category_task')->insert([
'category_id' => 1,
'task_id' => 618485,
]);
}
}

View File

@@ -0,0 +1,137 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\Template;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Http;
class DemoTemplateSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
foreach ($this->templates() as $template) {
Template::create($template);
}
foreach ($this->templateUrls() as $template) {
if (! File::exists(templates_path().basename($template['fileName']))) {
$response = Http::get($template['url']);
File::put(templates_path().basename($template['fileName']), $response->body());
}
}
}
public function templateUrls()
{
return [
[
'name' => 'Template 1',
'fileName' => '/app/rconfig/templates/brocade.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Brocade/brocade.yml',
],
[
'name' => 'Template 2',
'fileName' => '/app/rconfig/templates/CheckpointGaiaOS_NoEnable.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Checkpoint/CheckpointGaiaOS_NoEnable.yml',
],
[
'name' => 'Template 3',
'fileName' => '/app/rconfig/templates/dell-s4048-ssh-noenable.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Dell/dell-s4048-ssh-noenable.yml',
],
[
'name' => 'Template 4',
'fileName' => '/app/rconfig/templates/hp-procurve-ssh-noenable-v2.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/HP/hp-procurve-ssh-noenable-v2.yml',
],
[
'name' => 'Template 5',
'fileName' => '/app/rconfig/templates/Sonicwall-ssh-no-enable.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Palo%20Alto%20Networks/panos-ssh.yml',
],
[
'name' => 'Template 6',
'fileName' => '/app/rconfig/templates/panos-ssh.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Palo%20Alto%20Networks/panos-ssh.yml',
],
[
'name' => 'Template 7',
'fileName' => '/app/rconfig/templates/Sonicwall-ssh-no-enable.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Sonicwall/Sonicwall-ssh-no-enable.yml',
],
[
'name' => 'Template 8',
'fileName' => '/app/rconfig/templates/centos-7-ssh.yml',
'url' => 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/linux/centos-7-ssh.yml',
],
];
}
public function templates()
{
return [
[
'id' => 5,
'fileName' => '/app/rconfig/templates/brocade.yml',
'templateName' => 'Brocade_Devices',
'description' => 'Brocade Connection Teamplate',
'created_at' => '2022-04-18 11:36:07',
'updated_at' => '2022-04-18 11:36:07',
],
[
'id' => 6,
'fileName' => '/app/rconfig/templates/CheckpointGaiaOS_NoEnable.yml',
'templateName' => 'Checkpoint Gaia',
'description' => 'Checkpoint Gaia connection template',
'created_at' => '2022-04-18 11:36:15',
'updated_at' => '2022-04-18 11:36:15',
],
[
'id' => 7,
'fileName' => '/app/rconfig/templates/dell-s4048-ssh-noenable.yml',
'templateName' => 'Dell S4048 ssh noenable',
'description' => 'Dell S4048 ssh noenable',
'created_at' => '2022-04-18 11:36:22',
'updated_at' => '2022-04-18 11:36:22',
],
[
'id' => 8,
'fileName' => '/app/rconfig/templates/hp-procurve-ssh-noenable-v2.yml',
'templateName' => 'HP Procurve SSH noenable v2',
'description' => 'HP Procurve SSH noenable v2 for v5 users',
'created_at' => '2022-04-18 11:36:31',
'updated_at' => '2022-04-18 11:36:31',
],
[
'id' => 9,
'fileName' => '/app/rconfig/templates/panos-ssh.yml',
'templateName' => 'Palo Alto - SSH - No Configure Mode',
'description' => 'Palo Alto Networks PAN-OS SSH based connection without configuration mode',
'created_at' => '2022-04-18 11:36:43',
'updated_at' => '2022-04-18 11:36:43',
],
[
'id' => 10,
'fileName' => '/app/rconfig/templates/Sonicwall-ssh-no-enable.yml',
'templateName' => 'Sonicwall-ssh-no-enable',
'description' => 'Sonicwall SSH based connection without enable mode',
'created_at' => '2022-04-18 11:36:53',
'updated_at' => '2022-04-18 11:36:53',
],
[
'id' => 11,
'fileName' => '/app/rconfig/templates/centos-7-ssh.yml',
'templateName' => 'Centos 7 SSH',
'description' => 'Centos 7 SSH',
'created_at' => '2022-04-18 11:37:02',
'updated_at' => '2022-04-18 11:37:02',
],
];
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Database\Seeders\demodata;
use App\Models\User;
use Illuminate\Database\Seeder;
class DemoUserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
User::factory()
->count(20)
->create();
}
}

View File

@@ -0,0 +1,42 @@
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 192.168.1.254 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.168.1.254
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet1
L 192.168.1.170/32 is directly connected, GigabitEthernet1
192.168.50.0/32 is subnetted, 25 subnets
C 192.168.50.10 is directly connected, Loopback10
C 192.168.50.20 is directly connected, Loopback20
C 192.168.50.30 is directly connected, Loopback30
C 192.168.50.40 is directly connected, Loopback40
C 192.168.50.50 is directly connected, Loopback50
C 192.168.50.60 is directly connected, Loopback60
C 192.168.50.70 is directly connected, Loopback70
C 192.168.50.80 is directly connected, Loopback80
C 192.168.50.90 is directly connected, Loopback90
C 192.168.50.100 is directly connected, Loopback100
C 192.168.50.110 is directly connected, Loopback110
C 192.168.50.120 is directly connected, Loopback120
C 192.168.50.130 is directly connected, Loopback130
C 192.168.50.140 is directly connected, Loopback140
C 192.168.50.150 is directly connected, Loopback150
C 192.168.50.160 is directly connected, Loopback160
C 192.168.50.170 is directly connected, Loopback170
C 192.168.50.180 is directly connected, Loopback180
C 192.168.50.190 is directly connected, Loopback190
C 192.168.50.200 is directly connected, Loopback200
C 192.168.50.210 is directly connected, Loopback210
C 192.168.50.220 is directly connected, Loopback220
C 192.168.50.230 is directly connected, Loopback230
C 192.168.50.240 is directly connected, Loopback240
C 192.168.50.250 is directly connected, Loopback250

View File

@@ -0,0 +1 @@
*21:02:44.168 UTC Mon Apr 18 2022

View File

@@ -0,0 +1,290 @@
Building configuration...
Current configuration : 6068 bytes
!
! Last configuration change at 20:21:09 UTC Mon Apr 18 2022 by cisco
!
version 16.6
service timestamps debug datetime msec
service timestamps log datetime msec
platform qfp utilization monitor load 80
no platform punt-keepalive disable-kernel-core
platform console virtual
!
hostname router1
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$PYMP$ShFY8kvekfirjMFGsPnRZ0
enable password cisco
!
no aaa new-model
clock timezone UTC 6 0
!
!
!
!
!
!
!
no ip domain lookup
ip domain name rconfig.com
!
!
!
!
!
!
!
!
!
!
subscriber templating
!
!
!
!
!
ipv6 unicast-routing
!
!
multilink bundle-name authenticated
!
!
!
!
!
crypto pki trustpoint TP-self-signed-3203581333
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-3203581333
revocation-check none
rsakeypair TP-self-signed-3203581333
!
!
crypto pki certificate chain TP-self-signed-3203581333
certificate self-signed 01
30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030
31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
69666963 6174652D 33323033 35383133 3333301E 170D3138 30323139 31363138
35335A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D33 32303335
38313333 33308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201
0A028201 0100B0EF E78AFC15 6EAC5477 CE419D4C 15860478 CE0AD4ED B68DA36C
25970FF8 13EB3984 9072219E F0104C53 955AC0BA FE6C7CAA 3A5A77F7 829C0AA5
58B0C1F1 597C3153 1A48D41C 0D62D690 D4407FD3 5C4F79B7 A7558069 EB6B3781
15F6303C 48817F96 2DEB3138 1C546F07 AAB0AED0 BBFA856D 4F626389 BFBC9BFC
1BFDA2A7 768E2DB4 A90A4473 0F064EC9 1213901F 0437E0EA A28A2573 5319F6F5
2B698C41 3945BC82 5378F2FF 83889D99 C8DBA4F7 C0FC6706 78D43969 9CBCD667
3B967105 F22B7069 C64E1C35 746BF7F5 5B3C6376 E7AAD884 E5FBF3DB 66B46A05
FDAE94D6 3AB8BAC5 8B154962 8E62D631 19204B30 14A0967C B2DAB3A8 4E97FB42
AE982089 B9030203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF
301F0603 551D2304 18301680 145B2A1D F9BDAA8C E79CE831 8AE1EE1F E42B9F72
16301D06 03551D0E 04160414 5B2A1DF9 BDAA8CE7 9CE8318A E1EE1FE4 2B9F7216
300D0609 2A864886 F70D0101 05050003 82010100 52F30C26 AF408604 9D46ABF1
44D2566A 046D8C95 990328A0 5FD4A770 384284BC 1229EFB5 5C95C134 050C0D23
53E74557 C169D3BC 90DF1180 B683FDA1 0F550F26 87FB8584 81231A17 64552366
B7754EF2 71025D62 8FF6846A 64747CEA 6CF14A2A C9EDD401 2EF9126A FD78A55D
65663905 FE9BE0C2 BA96EB21 3454828E 56273331 A11C8CAE C3185448 79FAE7B7
B9A5A699 0DD85919 11F43A27 A5AD9590 25074292 F4136514 299B986E 125776DA
6F15275E 8636EFDC 4F50CF63 EB55A2F2 73FA14B9 CE25735E 913464B6 97E4DC98
8F02F826 EB16D936 E7998AEB 860D93A7 FA6B5D18 1093E21C 975C153B 26ADDF6F
696ABE1C 4F8BD80C 6B03F920 EBB602CF E1438D53
quit
!
!
!
!
!
!
!
!
!
license udi pid CSR1000V sn 9FM4W37HHOV
diagnostic bootup level minimal
spanning-tree extend system-id
!
!
!
username cisco privilege 15 password 0 cisco
username stephen password 0 stephen
username steve password 0 steve
username cisco1 password 0 cisco
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback10
ip address 192.168.50.10 255.255.255.255
!
interface Loopback20
ip address 192.168.50.20 255.255.255.255
!
interface Loopback30
ip address 192.168.50.30 255.255.255.255
!
interface Loopback40
ip address 192.168.50.40 255.255.255.255
!
interface Loopback50
ip address 192.168.50.50 255.255.255.255
!
interface Loopback60
ip address 192.168.50.60 255.255.255.255
!
interface Loopback70
ip address 192.168.50.70 255.255.255.255
!
interface Loopback80
ip address 192.168.50.80 255.255.255.255
!
interface Loopback90
ip address 192.168.50.90 255.255.255.255
!
interface Loopback100
ip address 192.168.50.100 255.255.255.255
!
interface Loopback110
ip address 192.168.50.110 255.255.255.255
!
interface Loopback120
ip address 192.168.50.120 255.255.255.255
!
interface Loopback130
ip address 192.168.50.130 255.255.255.255
!
interface Loopback140
ip address 192.168.50.140 255.255.255.255
!
interface Loopback150
ip address 192.168.50.150 255.255.255.255
!
interface Loopback160
ip address 192.168.50.160 255.255.255.255
!
interface Loopback170
ip address 192.168.50.170 255.255.255.255
!
interface Loopback180
ip address 192.168.50.180 255.255.255.255
!
interface Loopback190
ip address 192.168.50.190 255.255.255.255
!
interface Loopback200
ip address 192.168.50.200 255.255.255.255
!
interface Loopback210
ip address 192.168.50.210 255.255.255.255
!
interface Loopback220
ip address 192.168.50.220 255.255.255.255
!
interface Loopback230
ip address 192.168.50.230 255.255.255.255
!
interface Loopback240
ip address 192.168.50.240 255.255.255.255
!
interface Loopback250
ip address 192.168.50.250 255.255.255.255
!
interface GigabitEthernet1
description This is a test desc
ip address 192.168.1.170 255.255.255.0
negotiation auto
ipv6 address 2001:BB6:788A:8000::/64 eui-64
ipv6 address 2001:bb6:788a:8000:6273:5cff:fed9:4c01/64
no mop enabled
no mop sysid
!
interface GigabitEthernet2
no ip address
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet3
no ip address
negotiation auto
no mop enabled
no mop sysid
!
router bgp 64000
bgp log-neighbor-changes
network 1.1.1.1
network 1.1.1.2
network 1.1.1.3
network 1.1.1.4
network 2.2.2.2
network 2.2.2.3
network 2.2.2.4
network 2.2.2.5
!
!
virtual-service csr_mgmt
!
ip forward-protocol nd
ip http server
ip http authentication local
ip http secure-server
ip http client source-interface GigabitEthernet1
ip route 0.0.0.0 0.0.0.0 192.168.1.254
!
!
!
!
snmp-server host 1.1.1.1 TESTCOMMUNITY
snmp-server host 1.1.1.1 TESTCOMMUNITY10
snmp-server host 1.1.1.1 TESTCOMMUNITY30
!
!
control-plane
!
!
!
!
!
!
line con 0
exec-timeout 0 0
stopbits 1
line vty 0 4
password cisco
login local
transport input telnet ssh
!
ntp server pool.ntp.org
ntp server time-pnp.cisco.comi.
wsma agent exec
!
wsma agent config
!
wsma agent filesys
!
wsma agent notify
!
!
end

View File

@@ -0,0 +1,56 @@
Cisco IOS XE Software, Version 16.06.02
Cisco IOS Software [Everest], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.6.2, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2017 by Cisco Systems, Inc.
Compiled Wed 01-Nov-17 07:24 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2017 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.
ROM: IOS-XE ROMMON
router1 uptime is 8 weeks, 16 hours, 45 minutes
Uptime for this control processor is 8 weeks, 16 hours, 46 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"
Last reload reason: reload
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Level: ax
License Type: Default. No valid license found.
Next reload license Level: ax
cisco CSR1000V (VXE) processor (revision VXE) with 2190795K/3075K bytes of memory.
Processor board ID 9FM4W37HHOV
3 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
3984840K bytes of physical memory.
7774207K bytes of virtual hard disk at bootflash:.
0K bytes of WebUI ODM Files at webui:.
Configuration register is 0x2102

View File

@@ -0,0 +1,888 @@
<!DOCTYPE html>
<html lang="en" class="layout-pf layout-pf-fixed">
<head>
<meta charset="UTF-8">
<title>rConfig6 - Network Configuration Management</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">
<style>
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 300;
src: url(../fonts/OpenSans-Light-webfont.eot);
src: local("Open Sans Light"), local("OpenSans-Light"), url(../fonts/OpenSans-Light-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-Light-webfont.woff2) format("woff2"), url(../fonts/OpenSans-Light-webfont.woff) format("woff"), url(../fonts/OpenSans-Light-webfont.ttf) format("truetype"), url(../fonts/OpenSans-Light-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: url(../fonts/OpenSans-Regular-webfont.eot);
src: local("Open Sans"), local("OpenSans"), url(../fonts/OpenSans-Regular-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-Regular-webfont.woff2) format("woff2"), url(../fonts/OpenSans-Regular-webfont.woff) format("woff"), url(../fonts/OpenSans-Regular-webfont.ttf) format("truetype"), url(../fonts/OpenSans-Regular-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 300;
src: url(../fonts/OpenSans-LightItalic-webfont.eot);
src: local("Open Sans Light Italic"), local("OpenSansLight-Italic"), url(../fonts/OpenSans-LightItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-LightItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans-LightItalic-webfont.woff) format("woff"), url(../fonts/OpenSans-LightItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans-LightItalic-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 400;
src: url(../fonts/OpenSans-Italic-webfont.eot);
src: local("Open Sans Italic"), local("OpenSans-Italic"), url(../fonts/OpenSans-Italic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-Italic-webfont.woff2) format("woff2"), url(../fonts/OpenSans-Italic-webfont.woff) format("woff"), url(../fonts/OpenSans-Italic-webfont.ttf) format("truetype"), url(../fonts/OpenSans-Italic-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 600;
src: url(../fonts/OpenSans-Semibold-webfont.eot);
src: local("Open Sans Semibold"), local("OpenSans-Semibold-webfont"), url(../fonts/OpenSans-Semibold-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-Semibold-webfont.woff2) format("woff2"), url(../fonts/OpenSans-Semibold-webfont.woff) format("woff"), url(../fonts/OpenSans-Semibold-webfont.ttf) format("truetype"), url(../fonts/OpenSans-Semibold-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 600;
src: url(../fonts/OpenSans-SemiboldItalic-webfont.eot);
src: local("Open Sans Semibold Italic"), local("OpenSans-SemiboldItalic-webfont"), url(../fonts/OpenSans-SemiboldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-SemiboldItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans-SemiboldItalic-webfont.woff) format("woff"), url(../fonts/OpenSans-SemiboldItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans-SemiboldItalic-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 700;
src: url(../fonts/OpenSans-Bold-webfont.eot);
src: local("Open Sans Bold"), local("OpenSans-Bold"), url(../fonts/OpenSans-Bold-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-Bold-webfont.woff2) format("woff2"), url(../fonts/OpenSans-Bold-webfont.woff) format("woff"), url(../fonts/OpenSans-Bold-webfont.ttf) format("truetype"), url(../fonts/OpenSans-Bold-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 700;
src: url(../fonts/OpenSans-BoldItalic-webfont.eot);
src: local("Open Sans Bold Italic"), local("OpenSans-BoldItalic"), url(../fonts/OpenSans-BoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-BoldItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans-BoldItalic-webfont.woff) format("woff"), url(../fonts/OpenSans-BoldItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans-BoldItalic-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 800;
src: url(../fonts/OpenSans-ExtraBoldItalic-webfont.eot);
src: local("Open Sans Extrabold Italic"), local("OpenSans-ExtraboldItalic"), url(../fonts/OpenSans-ExtraBoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-ExtraBoldItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans-ExtraBoldItalic-webfont.woff) format("woff"), url(../fonts/OpenSans-ExtraBoldItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans-ExtraBoldItalic-webfont.svg#OpenSans) format("svg")
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 800;
src: url(../fonts/OpenSans-ExtraBold-webfont.eot);
src: local("Open Sans Extrabold"), local("OpenSans-Extrabold"), url(../fonts/OpenSans-ExtraBold-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans-ExtraBold-webfont.woff2) format("woff2"), url(../fonts/OpenSans-ExtraBold-webfont.woff) format("woff"), url(../fonts/OpenSans-ExtraBold-webfont.ttf) format("truetype"), url(../fonts/OpenSans-ExtraBold-webfont.svg#OpenSans) format("svg")
}
/*!
* Bootstrap v3.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%
}
body {
margin: 0
}
a {
background-color: transparent
}
a:active,
a:hover {
outline: 0
}
strong {
font-weight: 700
}
h1 {
font-size: 2em;
margin: .67em 0
}
img {
border: 0
}
table {
border-collapse: collapse;
border-spacing: 0
}
td,
th {
padding: 0
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
:after,
:before {
color: #000 !important;
text-shadow: none !important;
background: 0 0 !important;
box-shadow: none !important
}
a,
a:visited {
text-decoration: underline
}
a[href]:after {
content: " ("attr(href) ")"
}
thead {
display: table-header-group
}
img,
tr {
page-break-inside: avoid
}
img {
max-width: 100% !important
}
h2,
p {
orphans: 3;
widows: 3
}
h2 {
page-break-after: avoid
}
}
@font-face {
font-family: "Glyphicons Halflings";
src: url(../fonts/glyphicons-halflings-regular.eot);
src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"), url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"), url(../fonts/glyphicons-halflings-regular.woff) format("woff"), url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"), url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")
}
* {
box-sizing: border-box
}
:after,
:before {
box-sizing: border-box
}
html {
font-size: 10px;
-webkit-tap-highlight-color: transparent
}
body {
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 12px;
line-height: 1.66666667;
color: #363636;
background-color: #fff
}
a {
color: #0088ce;
text-decoration: none
}
a:focus,
a:hover {
color: #00659c;
text-decoration: underline
}
a:focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px
}
img {
vertical-align: middle
}
h1,
h2,
h4 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit
}
h1,
h2 {
margin-top: 20px;
margin-bottom: 10px
}
h4 {
margin-top: 10px;
margin-bottom: 10px
}
h1 {
font-size: 24px
}
h2 {
font-size: 22px
}
h4 {
font-size: 15px
}
p {
margin: 0 0 10px
}
.row {
margin-right: -20px;
margin-left: -20px
}
.col-md-4,
.col-md-6,
.col-sm-6,
.col-xs-12 {
position: relative;
min-height: 1px;
padding-right: 20px;
padding-left: 20px
}
.col-xs-12 {
float: left
}
.col-xs-12 {
width: 100%
}
@media (min-width:768px) {
.col-sm-6 {
float: left
}
.col-sm-6 {
width: 50%
}
}
@media (min-width:992px) {
.col-md-4,
.col-md-6 {
float: left
}
.col-md-6 {
width: 50%
}
.col-md-4 {
width: 33.33333333%
}
}
table {
background-color: transparent
}
th {
text-align: left
}
.row:after,
.row:before {
display: table;
content: " "
}
.row:after {
clear: both
}
@-ms-viewport {
width: device-width
}
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@font-face {
font-family: FontAwesome;
src: url(../fonts/fontawesome-webfont.eot?v=4.7.0);
src: url(../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'), url(../fonts/fontawesome-webfont.woff2?v=4.7.0) format('woff2'), url(../fonts/fontawesome-webfont.woff?v=4.7.0) format('woff'), url(../fonts/fontawesome-webfont.ttf?v=4.7.0) format('truetype'), url(../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');
font-weight: 400;
font-style: normal
}
@supports (display:flex) {}
@supports (display:flex) {}
@supports (display:flex) {}
h1,
h2 {
font-weight: 300
}
/*!
* Datetimepicker for Bootstrap 3
* version : 4.17.47
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
.card-pf {
background: #fff;
border-top: 2px solid transparent;
box-shadow: 0 1px 1px rgba(3, 3, 3, .175);
margin: 0 -10px 20px;
padding: 0 20px
}
.card-pf.card-pf-accented {
border-top-color: #39a5dc
}
.card-pf.card-pf-aggregate-status {
padding: 0 10px;
text-align: center
}
.card-pf-body {
margin: 20px 0 0;
padding: 0 0 20px
}
.card-pf-aggregate-status .card-pf-body {
margin-top: 10px;
padding-bottom: 10px
}
.card-pf-body>:last-child {
margin-bottom: 0
}
.card-pf-title {
font-size: 16px;
font-weight: 400;
margin: 20px 0;
padding: 0
}
.card-pf-aggregate-status .card-pf-title {
font-size: 14px;
margin: 10px 0 0
}
.card-pf-utilization-details {
border-bottom: 1px solid #d1d1d1;
display: table;
margin: 12px 0 15px;
padding: 0 0 15px;
width: 100%
}
.card-pf-utilization-details .card-pf-utilization-card-details-count,
.card-pf-utilization-details .card-pf-utilization-card-details-description {
float: left;
line-height: 1
}
.card-pf-utilization-details .card-pf-utilization-card-details-count {
font-size: 26px;
font-weight: 300;
margin-right: 10px
}
.card-pf-utilization-details .card-pf-utilization-card-details-line-1,
.card-pf-utilization-details .card-pf-utilization-card-details-line-2 {
display: block
}
.card-pf-utilization-details .card-pf-utilization-card-details-line-1 {
font-size: 10px;
margin-bottom: 2px
}
.cards-pf {
background: #f5f5f5
}
.cards-pf .row-cards-pf {
padding: 0 20px
}
.cards-pf .row-cards-pf:first-child {
padding-top: 20px
}
.row-cards-pf {
margin-left: -10px;
margin-right: -10px
}
@font-face {
font-family: PatternFlyIcons-webfont;
src: url(../fonts/PatternFlyIcons-webfont.eot);
src: url(../fonts/PatternFlyIcons-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/PatternFlyIcons-webfont.ttf) format("truetype"), url(../fonts/PatternFlyIcons-webfont.woff) format("woff"), url(../fonts/PatternFlyIcons-webfont.svg#PatternFlyIcons-webfont) format("svg");
font-weight: 400;
font-style: normal
}
.layout-pf,
.layout-pf body {
min-height: 100%
}
.layout-pf.layout-pf-fixed body {
padding-top: 60px
}
.login-pf-page .login-pf-header .bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) .dropdown-toggle:not(:focus) {
box-shadow: none;
border: 1px solid transparent
}
@supports (display:flex) {}
@supports (display:flex) {}
@supports (display:flex) {}
@supports (display:flex) {}
@supports (display:flex) {}
.multiselect__content::webkit-scrollbar {
display: none
}
.versionChangeYes {
background: #ea4335;
padding-left: 2px;
}
.versionChangeNo {
background: #c4d6a4;
padding-left: 2px;
}
@media (max-width: 768px) {
tr th:nth-child(2),
tr td:nth-child(2) {
display: none;
}
tr th:nth-child(3),
tr td:nth-child(3) {
display: none;
}
tr th:nth-child(4),
tr td:nth-child(4) {
display: none;
}
}
</style>
</head>
<body class="cards-pf ">
<div class="row row-cards-pf" style="margin-bottom: 30px;">
<div class="col-xs-12 col-sm-6 col-md-6">
<img src="https://www.rconfig.com/images/rConfig_logos/new/blue/hex_logo_blue_horizontal_72.png" alt="rConfig Logo" />
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<h1><strong>Task Download Report</strong></h1>
</div>
</div>
<div class="row row-cards-pf" style="margin-bottom: 30px;">
<div class="col-xs-12 col-sm-6 col-md-6">
<h4><strong>Exectution Date/Time:</strong> 2022-04-18 22:34:09</h4>
<h4><strong>Task ID/ Name:</strong> 618485 / Download Routers </h4>
<h4><strong>Task Description:</strong> Download Routers Category once a week</h4>
</div>
</div>
<div class="row row-cards-pf">
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">
Device Count
</h2>
<div class="card-pf-body" style="display: inline-block">
<p class="card-pf-utilization-details" style="border: none; text-align: center">
<span class="card-pf-utilization-card-details-count">25</span>
</p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">
Successes/ Failures
</h2>
<div class="card-pf-body" style="display: inline-block">
<p class="card-pf-utilization-details" style="border: none; text-align: center">
<span class="card-pf-utilization-card-details-count">
20
/ 5
</span>
</p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">
Execution Time
</h2>
<div class="card-pf-body" style="display: inline-block">
<p class="card-pf-utilization-details" style="border: none; text-align: center">
<span class="card-pf-utilization-card-details-count">273</span>
<span class="card-pf-utilization-card-details-description">
<span class="card-pf-utilization-card-details-line-1"></span>
<span class="card-pf-utilization-card-details-line-2">seconds</span>
</span>
</p>
</div>
</div>
</div>
</div>
<div class="row row-cards-pf" style="margin:1px">
<table style="width: 100%;">
<tr style="background-color: #2196f3; color:white;">
<td style=""><strong>Configuration downloads for this task listed below</strong>
</td>
</tr>
</table>
<table style="width: 100%;">
<thead style="border-bottom-style: solid; border-bottom-color: #dddddd; border-bottom-width: 1px;">
<th>Device Name</th>
<th>Category</th>
<th>Command Count</th>
<th>Start Time</th>
<th>End Time</th>
<th>Execution Time</th>
<th>Status</th>
</thead>
<tbody>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500012">router12</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500012">3</a></td>
<td>2022-04-18 22:35:12</td>
<td>2022-04-18 22:36:01</td>
<td>48</td>
<td style="background: #ea4335; padding-left: 2px;">Failed</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500016">router16</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500016">3</a></td>
<td>2022-04-18 22:36:05</td>
<td>2022-04-18 22:36:53</td>
<td>48</td>
<td style="background: #ea4335; padding-left: 2px;">Failed</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500020">router20</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500020">3</a></td>
<td>2022-04-18 22:36:57</td>
<td>2022-04-18 22:37:46</td>
<td>48</td>
<td style="background: #ea4335; padding-left: 2px;">Failed</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500022">router22</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500022">3</a></td>
<td>2022-04-18 22:37:47</td>
<td>2022-04-18 22:38:35</td>
<td>48</td>
<td style="background: #ea4335; padding-left: 2px;">Failed</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50004">router4</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50004">3</a></td>
<td>2022-04-18 22:34:14</td>
<td>2022-04-18 22:35:02</td>
<td>48</td>
<td style="background: #ea4335; padding-left: 2px;">Failed</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50001">router1</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50001">3</a></td>
<td>2022-04-18 22:34:09</td>
<td>2022-04-18 22:34:11</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500010">router10</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500010">3</a></td>
<td>2022-04-18 22:35:09</td>
<td>2022-04-18 22:35:11</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500011">router11</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500011">3</a></td>
<td>2022-04-18 22:35:11</td>
<td>2022-04-18 22:35:12</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500013">router13</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500013">3</a></td>
<td>2022-04-18 22:36:01</td>
<td>2022-04-18 22:36:02</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500014">router14</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500014">3</a></td>
<td>2022-04-18 22:36:02</td>
<td>2022-04-18 22:36:03</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500015">router15</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500015">3</a></td>
<td>2022-04-18 22:36:03</td>
<td>2022-04-18 22:36:05</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500017">router17</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500017">3</a></td>
<td>2022-04-18 22:36:53</td>
<td>2022-04-18 22:36:55</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500018">router18</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500018">3</a></td>
<td>2022-04-18 22:36:55</td>
<td>2022-04-18 22:36:56</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500019">router19</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500019">3</a></td>
<td>2022-04-18 22:36:56</td>
<td>2022-04-18 22:36:57</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50002">router2</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50002">3</a></td>
<td>2022-04-18 22:34:11</td>
<td>2022-04-18 22:34:12</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500021">router21</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500021">3</a></td>
<td>2022-04-18 22:37:46</td>
<td>2022-04-18 22:37:47</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500023">router23</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500023">3</a></td>
<td>2022-04-18 22:38:35</td>
<td>2022-04-18 22:38:37</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500024">router24</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500024">3</a></td>
<td>2022-04-18 22:38:37</td>
<td>2022-04-18 22:38:38</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500025">router25</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/500025">3</a></td>
<td>2022-04-18 22:38:38</td>
<td>2022-04-18 22:38:40</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50003">router3</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50003">3</a></td>
<td>2022-04-18 22:34:12</td>
<td>2022-04-18 22:34:14</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50005">router5</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50005">3</a></td>
<td>2022-04-18 22:35:02</td>
<td>2022-04-18 22:35:04</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50006">router6</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50006">3</a></td>
<td>2022-04-18 22:35:04</td>
<td>2022-04-18 22:35:05</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50007">router7</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50007">3</a></td>
<td>2022-04-18 22:35:05</td>
<td>2022-04-18 22:35:06</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50008">router8</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50008">3</a></td>
<td>2022-04-18 22:35:07</td>
<td>2022-04-18 22:35:08</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
<tr>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50009">router9</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/categories">Routers</a></td>
<td><a target="_blank" href="http://v6dev1.rconfig.com/device/view/50009">3</a></td>
<td>2022-04-18 22:35:08</td>
<td>2022-04-18 22:35:09</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px;">Success</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@@ -0,0 +1,821 @@
<!DOCTYPE html>
<html lang="en" class="layout-pf layout-pf-fixed">
<head>
<meta charset="UTF-8" />
<title>rConfig6 - Network Configuration Management</title>
<link
href="https://fonts.googleapis.com/css?family=Raleway:300,400,600"
rel="stylesheet"
type="text/css"
/>
<style>
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 300;
src: url(../fonts/OpenSans-Light-webfont.eot);
src: local("Open Sans Light"), local("OpenSans-Light"),
url(../fonts/OpenSans-Light-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-Light-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-Light-webfont.woff) format("woff"),
url(../fonts/OpenSans-Light-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-Light-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: url(../fonts/OpenSans-Regular-webfont.eot);
src: local("Open Sans"), local("OpenSans"),
url(../fonts/OpenSans-Regular-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-Regular-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-Regular-webfont.woff) format("woff"),
url(../fonts/OpenSans-Regular-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-Regular-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 300;
src: url(../fonts/OpenSans-LightItalic-webfont.eot);
src: local("Open Sans Light Italic"), local("OpenSansLight-Italic"),
url(../fonts/OpenSans-LightItalic-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-LightItalic-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-LightItalic-webfont.woff) format("woff"),
url(../fonts/OpenSans-LightItalic-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-LightItalic-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 400;
src: url(../fonts/OpenSans-Italic-webfont.eot);
src: local("Open Sans Italic"), local("OpenSans-Italic"),
url(../fonts/OpenSans-Italic-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-Italic-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-Italic-webfont.woff) format("woff"),
url(../fonts/OpenSans-Italic-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-Italic-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 600;
src: url(../fonts/OpenSans-Semibold-webfont.eot);
src: local("Open Sans Semibold"), local("OpenSans-Semibold-webfont"),
url(../fonts/OpenSans-Semibold-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-Semibold-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-Semibold-webfont.woff) format("woff"),
url(../fonts/OpenSans-Semibold-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-Semibold-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 600;
src: url(../fonts/OpenSans-SemiboldItalic-webfont.eot);
src: local("Open Sans Semibold Italic"),
local("OpenSans-SemiboldItalic-webfont"),
url(../fonts/OpenSans-SemiboldItalic-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-SemiboldItalic-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-SemiboldItalic-webfont.woff) format("woff"),
url(../fonts/OpenSans-SemiboldItalic-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-SemiboldItalic-webfont.svg#OpenSans)
format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 700;
src: url(../fonts/OpenSans-Bold-webfont.eot);
src: local("Open Sans Bold"), local("OpenSans-Bold"),
url(../fonts/OpenSans-Bold-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-Bold-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-Bold-webfont.woff) format("woff"),
url(../fonts/OpenSans-Bold-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-Bold-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 700;
src: url(../fonts/OpenSans-BoldItalic-webfont.eot);
src: local("Open Sans Bold Italic"), local("OpenSans-BoldItalic"),
url(../fonts/OpenSans-BoldItalic-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-BoldItalic-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-BoldItalic-webfont.woff) format("woff"),
url(../fonts/OpenSans-BoldItalic-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-BoldItalic-webfont.svg#OpenSans) format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: italic;
font-weight: 800;
src: url(../fonts/OpenSans-ExtraBoldItalic-webfont.eot);
src: local("Open Sans Extrabold Italic"),
local("OpenSans-ExtraboldItalic"),
url(../fonts/OpenSans-ExtraBoldItalic-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-ExtraBoldItalic-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-ExtraBoldItalic-webfont.woff) format("woff"),
url(../fonts/OpenSans-ExtraBoldItalic-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-ExtraBoldItalic-webfont.svg#OpenSans)
format("svg");
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 800;
src: url(../fonts/OpenSans-ExtraBold-webfont.eot);
src: local("Open Sans Extrabold"), local("OpenSans-Extrabold"),
url(../fonts/OpenSans-ExtraBold-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/OpenSans-ExtraBold-webfont.woff2) format("woff2"),
url(../fonts/OpenSans-ExtraBold-webfont.woff) format("woff"),
url(../fonts/OpenSans-ExtraBold-webfont.ttf) format("truetype"),
url(../fonts/OpenSans-ExtraBold-webfont.svg#OpenSans) format("svg");
}
/*!
* Bootstrap v3.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
strong {
font-weight: 700;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
img {
border: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
:after,
:before {
color: #000 !important;
text-shadow: none !important;
background: 0 0 !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
thead {
display: table-header-group;
}
img,
tr {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
h2,
p {
orphans: 3;
widows: 3;
}
h2 {
page-break-after: avoid;
}
}
@font-face {
font-family: "Glyphicons Halflings";
src: url(../fonts/glyphicons-halflings-regular.eot);
src: url(../fonts/glyphicons-halflings-regular.eot?#iefix)
format("embedded-opentype"),
url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),
url(../fonts/glyphicons-halflings-regular.woff) format("woff"),
url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),
url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular)
format("svg");
}
* {
box-sizing: border-box;
}
:after,
:before {
box-sizing: border-box;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 12px;
line-height: 1.66666667;
color: #363636;
background-color: #fff;
}
a {
color: #0088ce;
text-decoration: none;
}
a:focus,
a:hover {
color: #00659c;
text-decoration: underline;
}
a:focus {
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
img {
vertical-align: middle;
}
h1,
h2,
h4 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
h1,
h2 {
margin-top: 20px;
margin-bottom: 10px;
}
h4 {
margin-top: 10px;
margin-bottom: 10px;
}
h1 {
font-size: 24px;
}
h2 {
font-size: 22px;
}
h4 {
font-size: 15px;
}
p {
margin: 0 0 10px;
}
.row {
margin-right: -20px;
margin-left: -20px;
}
.col-md-4,
.col-md-6,
.col-sm-6,
.col-xs-12 {
position: relative;
min-height: 1px;
padding-right: 20px;
padding-left: 20px;
}
.col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
@media (min-width: 768px) {
.col-sm-6 {
float: left;
}
.col-sm-6 {
width: 50%;
}
}
@media (min-width: 992px) {
.col-md-4,
.col-md-6 {
float: left;
}
.col-md-6 {
width: 50%;
}
.col-md-4 {
width: 33.33333333%;
}
}
table {
background-color: transparent;
}
th {
text-align: left;
}
.row:after,
.row:before {
display: table;
content: " ";
}
.row:after {
clear: both;
}
@-ms-viewport {
width: device-width;
}
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@font-face {
font-family: FontAwesome;
src: url(../fonts/fontawesome-webfont.eot?v=4.7.0);
src: url(../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0)
format("embedded-opentype"),
url(../fonts/fontawesome-webfont.woff2?v=4.7.0) format("woff2"),
url(../fonts/fontawesome-webfont.woff?v=4.7.0) format("woff"),
url(../fonts/fontawesome-webfont.ttf?v=4.7.0) format("truetype"),
url(../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular)
format("svg");
font-weight: 400;
font-style: normal;
}
@supports (display: flex) {
}
@supports (display: flex) {
}
@supports (display: flex) {
}
h1,
h2 {
font-weight: 300;
}
/*!
* Datetimepicker for Bootstrap 3
* version : 4.17.47
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
.card-pf {
background: #fff;
border-top: 2px solid transparent;
box-shadow: 0 1px 1px rgba(3, 3, 3, 0.175);
margin: 0 -10px 20px;
padding: 0 20px;
}
.card-pf.card-pf-accented {
border-top-color: #39a5dc;
}
.card-pf.card-pf-aggregate-status {
padding: 0 10px;
text-align: center;
}
.card-pf-body {
margin: 20px 0 0;
padding: 0 0 20px;
}
.card-pf-aggregate-status .card-pf-body {
margin-top: 10px;
padding-bottom: 10px;
}
.card-pf-body > :last-child {
margin-bottom: 0;
}
.card-pf-title {
font-size: 16px;
font-weight: 400;
margin: 20px 0;
padding: 0;
}
.card-pf-aggregate-status .card-pf-title {
font-size: 14px;
margin: 10px 0 0;
}
.card-pf-utilization-details {
border-bottom: 1px solid #d1d1d1;
display: table;
margin: 12px 0 15px;
padding: 0 0 15px;
width: 100%;
}
.card-pf-utilization-details .card-pf-utilization-card-details-count,
.card-pf-utilization-details
.card-pf-utilization-card-details-description {
float: left;
line-height: 1;
}
.card-pf-utilization-details .card-pf-utilization-card-details-count {
font-size: 26px;
font-weight: 300;
margin-right: 10px;
}
.card-pf-utilization-details .card-pf-utilization-card-details-line-1,
.card-pf-utilization-details .card-pf-utilization-card-details-line-2 {
display: block;
}
.card-pf-utilization-details .card-pf-utilization-card-details-line-1 {
font-size: 10px;
margin-bottom: 2px;
}
.cards-pf {
background: #f5f5f5;
}
.cards-pf .row-cards-pf {
padding: 0 20px;
}
.cards-pf .row-cards-pf:first-child {
padding-top: 20px;
}
.row-cards-pf {
margin-left: -10px;
margin-right: -10px;
}
@font-face {
font-family: PatternFlyIcons-webfont;
src: url(../fonts/PatternFlyIcons-webfont.eot);
src: url(../fonts/PatternFlyIcons-webfont.eot?#iefix)
format("embedded-opentype"),
url(../fonts/PatternFlyIcons-webfont.ttf) format("truetype"),
url(../fonts/PatternFlyIcons-webfont.woff) format("woff"),
url(../fonts/PatternFlyIcons-webfont.svg#PatternFlyIcons-webfont)
format("svg");
font-weight: 400;
font-style: normal;
}
.layout-pf,
.layout-pf body {
min-height: 100%;
}
.layout-pf.layout-pf-fixed body {
padding-top: 60px;
}
.login-pf-page
.login-pf-header
.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(
.input-group-btn
)
.dropdown-toggle:not(:focus) {
box-shadow: none;
border: 1px solid transparent;
}
@supports (display: flex) {
}
@supports (display: flex) {
}
@supports (display: flex) {
}
@supports (display: flex) {
}
@supports (display: flex) {
}
.multiselect__content::webkit-scrollbar {
display: none;
}
.versionChangeYes {
background: #ea4335;
padding-left: 2px;
}
.versionChangeNo {
background: #c4d6a4;
padding-left: 2px;
}
@media (max-width: 768px) {
tr th:nth-child(2),
tr td:nth-child(2) {
display: none;
}
tr th:nth-child(3),
tr td:nth-child(3) {
display: none;
}
tr th:nth-child(4),
tr td:nth-child(4) {
display: none;
}
}
</style>
</head>
<body class="cards-pf">
<div class="row row-cards-pf" style="margin-bottom: 30px">
<div class="col-xs-12 col-sm-6 col-md-6">
<img
src="https://www.rconfig.com/images/rConfig_logos/new/blue/hex_logo_blue_horizontal_72.png"
alt="rConfig Logo"
/>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<h1><strong>Task Download Report</strong></h1>
</div>
</div>
<div class="row row-cards-pf" style="margin-bottom: 30px">
<div class="col-xs-12 col-sm-6 col-md-6">
<h4><strong>Exectution Date/Time:</strong> 2022-04-18 22:28:24</h4>
<h4><strong>Task ID/ Name:</strong> 836229 / Download core devices</h4>
<h4>
<strong>Task Description:</strong> Download core devices configs once
per day
</h4>
</div>
</div>
<div class="row row-cards-pf">
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">Device Count</h2>
<div class="card-pf-body" style="display: inline-block">
<p
class="card-pf-utilization-details"
style="border: none; text-align: center"
>
<span class="card-pf-utilization-card-details-count">4</span>
</p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">Successes/ Failures</h2>
<div class="card-pf-body" style="display: inline-block">
<p
class="card-pf-utilization-details"
style="border: none; text-align: center"
>
<span class="card-pf-utilization-card-details-count">
3 / 1
</span>
</p>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">Execution Time</h2>
<div class="card-pf-body" style="display: inline-block">
<p
class="card-pf-utilization-details"
style="border: none; text-align: center"
>
<span class="card-pf-utilization-card-details-count">204</span>
<span class="card-pf-utilization-card-details-description">
<span class="card-pf-utilization-card-details-line-1"></span>
<span class="card-pf-utilization-card-details-line-2"
>seconds</span
>
</span>
</p>
</div>
</div>
</div>
</div>
<div class="row row-cards-pf" style="margin: 1px">
<table style="width: 100%">
<tr style="background-color: #2196f3; color: white">
<td style="">
<strong>Configuration downloads for this task listed below</strong>
</td>
</tr>
</table>
<table style="width: 100%">
<thead
style="
border-bottom-style: solid;
border-bottom-color: #dddddd;
border-bottom-width: 1px;
"
>
<th>Device Name</th>
<th>Category</th>
<th>Command Count</th>
<th>Start Time</th>
<th>End Time</th>
<th>Execution Time</th>
<th>Status</th>
</thead>
<tbody>
<tr>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/500012"
>router12</a
>
</td>
<td>
<a target="_blank" href="http://v6dev1.rconfig.com/categories"
>Routers</a
>
</td>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/500012"
>3</a
>
</td>
<td>2022-04-18 22:30:59</td>
<td>2022-04-18 22:31:47</td>
<td>48</td>
<td style="background: #ea4335; padding-left: 2px">Failed</td>
</tr>
<tr>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/50001"
>router1</a
>
</td>
<td>
<a target="_blank" href="http://v6dev1.rconfig.com/categories"
>Routers</a
>
</td>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/50001"
>3</a
>
</td>
<td>2022-04-18 22:30:54</td>
<td>2022-04-18 22:30:56</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px">Success</td>
</tr>
<tr>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/500010"
>router10</a
>
</td>
<td>
<a target="_blank" href="http://v6dev1.rconfig.com/categories"
>Routers</a
>
</td>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/500010"
>3</a
>
</td>
<td>2022-04-18 22:30:56</td>
<td>2022-04-18 22:30:57</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px">Success</td>
</tr>
<tr>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/500011"
>router11</a
>
</td>
<td>
<a target="_blank" href="http://v6dev1.rconfig.com/categories"
>Routers</a
>
</td>
<td>
<a
target="_blank"
href="http://v6dev1.rconfig.com/device/view/500011"
>3</a
>
</td>
<td>2022-04-18 22:30:57</td>
<td>2022-04-18 22:30:59</td>
<td>1</td>
<td style="background: #c4d6a4; padding-left: 2px">Success</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@@ -0,0 +1,508 @@
<?php
namespace Database\Seeders\testdata;
use App\Models\Device;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DeviceTableSeeder extends Seeder
{
// NOTE: This is only used for running tests
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$dev_cisco_ip = '192.168.1.170';
$dev_cisco_ipv6 = '2001:bb6:788a:8000:6273:5cff:fed9:4c01';
// telnet no enable template
Device::create([
'id' => 1001,
'device_name' => 'router1',
'device_ip' => $dev_cisco_ip,
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => '1#', // reduced for the new telnet readTo preg_match
'device_enable_prompt' => 'router1>',
'device_category_id' => 1,
'device_template' => 1,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// // telnet enable template
Device::create([
'id' => 1002,
'device_name' => 'router2',
'device_ip' => $dev_cisco_ip,
'device_default_creds_on' => 0,
'device_username' => 'cisco1',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => 1,
'device_template' => 2,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// SSH no enable template
Device::create([
'id' => 1003,
'device_name' => 'router3',
'device_ip' => 'router1.rconfig.com',
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'r1#', // mimics a partial cli prompt match - test and working
'device_enable_prompt' => 'router1>',
'device_category_id' => 1,
'device_template' => 3,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// SSH enable template
Device::create([
'id' => 1004,
'device_name' => 'router4',
'device_ip' => $dev_cisco_ip,
'device_default_creds_on' => 0,
'device_username' => 'cisco1',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => 1,
'device_template' => 4,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// Unreachable Device
Device::create([
'id' => 1005,
'device_name' => 'router5',
'device_ip' => '192.169.1.1',
'device_default_creds_on' => 0,
'device_username' => 'cisco1',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => 1,
'device_template' => 1,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// Device with Options Template Device - unused for most tests
Device::create([
'id' => 1006,
'device_name' => 'router6',
'device_ip' => $dev_cisco_ip,
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => 6000,
'device_template' => 2000,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
Device::create([
'id' => 1008,
'device_name' => 'router8',
'device_ip' => '10.0.0.111',
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => 8,
'device_template' => 1,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
Device::create([
'id' => 1009,
'device_name' => 'router1v6',
'device_ip' => $dev_cisco_ipv6,
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'router1#',
'device_enable_prompt' => 'router1>',
'device_category_id' => 8,
'device_template' => 1,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// SSH no enable template IPv6
Device::create([
'id' => 1010,
'device_name' => 'router1v6',
'device_ip' => $dev_cisco_ipv6,
'device_default_creds_on' => 0,
'device_username' => 'cisco',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => 'r1#', // mimics a partial cli prompt match - test and working
'device_enable_prompt' => 'router1>',
'device_category_id' => 1,
'device_template' => 3,
'device_model' => 'CSR1000v',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
// Linux Private Key
Device::create([
'id' => 1011,
'device_name' => 'homedev.rconfig.com',
'device_ip' => '192.168.1.2',
'device_default_creds_on' => 0,
'device_username' => 'root',
'device_password' => 'cisco',
'device_enable_password' => 'cisco',
'device_main_prompt' => '*', // mimics a partial cli prompt match - test and working
'device_enable_prompt' => '*',
'device_category_id' => 11,
'device_template' => 11,
'device_model' => 'centos8',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
'ssh_key_id' => 1,
]);
DB::table('commands')->insert([
'id' => 6000,
'command' => 'dev_cmd',
]);
DB::table('commands')->insert([
'id' => 11,
'command' => 'hostname',
]);
DB::table('category_command')->insert([
'category_id' => 6000,
'command_id' => 6000,
]);
DB::table('category_command')->insert([
'category_id' => 8,
'command_id' => 1,
]);
DB::table('category_command')->insert([
'category_id' => 11,
'command_id' => 11,
]);
DB::table('device_template')->insert([
'template_id' => 1,
'device_id' => '1001',
]);
DB::table('device_template')->insert([
'template_id' => 4,
'device_id' => '1004',
]);
DB::table('device_template')->insert([
'template_id' => 11,
'device_id' => '1011',
]);
DB::table('device_template')->insert([
'template_id' => 2000,
'device_id' => '1006',
]);
DB::table('device_template')->insert([
'template_id' => 2000,
'device_id' => '1008',
]);
DB::table('templates')->insert([
0 => [
'id' => '11',
'fileName' => '/app/rconfig/templates/ssh_priv_key_test.yml',
'templateName' => 'ssh_priv_key_test',
'description' => 'ssh_priv_key_test descr',
'created_at' => '2021-02-27 12:09:44',
'updated_at' => null,
],
]);
// seed categories and relationships
DB::table('categories')->insert([
'id' => 1010,
'categoryName' => 'devcategory10',
'categoryDescription' => 'This will always be a dummy category - i.e. no devices attached',
]);
DB::table('categories')->insert([
'id' => 1011,
'categoryName' => 'devcategory11',
'categoryDescription' => 'This will always be a dummy category - i.e. no devices attached, but has a command',
]);
DB::table('category_command')->insert([
'category_id' => 1011,
'command_id' => 6000,
]);
DB::table('categories')->insert([
'id' => '8',
'categoryName' => 'Unreachable_devices',
'categoryDescription' => null,
'badgeColor' => 'badge-primary',
'created_at' => '2018-06-06 22:20:44',
'updated_at' => null,
]);
DB::table('categories')->insert([
'id' => 6000,
'categoryName' => 'dev_cat',
]);
DB::table('categories')->insert([
'id' => 11,
'categoryName' => 'dev_linux',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1001',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1002',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1003',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1004',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1005',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1009',
]);
DB::table('category_device')->insert([
'category_id' => 1,
'device_id' => '1010',
]);
DB::table('category_device')->insert([
'category_id' => 55,
'device_id' => '1006',
]);
DB::table('category_device')->insert([
'category_id' => 8,
'device_id' => '1008',
]);
DB::table('category_device')->insert([
'category_id' => 11,
'device_id' => '1011',
]);
// seed categories and relationships
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1001',
]);
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1002',
]);
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1003',
]);
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1004',
]);
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1005',
]);
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1006',
]);
DB::table('device_vendor')->insert([
'vendor_id' => 1,
'device_id' => '1008',
]);
//seed tags and relationships
DB::table('tags')->insert([
'id' => 1001,
'tagname' => 'devtag1',
'tagDescription' => 'test tag description 1',
]);
DB::table('tags')->insert([
'id' => 1002,
'tagname' => 'devtag2',
'tagDescription' => 'test tag description 2',
]);
DB::table('tags')->insert([
'id' => 1003,
'tagname' => 'devtag3',
'tagDescription' => 'test tag description 3',
]);
DB::table('tags')->insert([
'id' => 1010,
'tagname' => 'devtag10',
'tagDescription' => 'This will always be a dummy tag - i.e. no devices attached',
]);
DB::table('device_tag')->insert([
'device_id' => 1001,
'tag_id' => 1001,
]);
DB::table('device_tag')->insert([
'device_id' => 1002,
'tag_id' => 1002,
]);
DB::table('device_tag')->insert([
'device_id' => 1005,
'tag_id' => 1003,
]);
DB::table('device_tag')->insert([
'device_id' => 1006,
'tag_id' => 55,
]);
//Seed tasks and relationships
DB::table('tasks')->insert([
'id' => 555555,
'task_name' => 'DevTask1',
'task_desc' => 'DevTask1 Description',
'task_command' => 'rconfig:download-device',
'task_categories' => null,
'task_devices' => 1,
'task_tags' => null,
'task_cron' => '0 0 * * 0 ',
'task_email_notify' => 1,
'download_report_notify' => 0,
'verbose_download_report_notify' => 0,
'is_system' => 0,
]);
DB::table('tasks')->insert([
'id' => 666666,
'task_name' => 'DevTask2',
'task_desc' => 'DevTask2 Description',
'task_command' => 'rconfig:download-tag',
'task_categories' => null,
'task_devices' => null,
'task_tags' => 1,
'task_cron' => '0 0 * * 0 ',
'task_email_notify' => 0,
'download_report_notify' => 0,
'verbose_download_report_notify' => 0,
'is_system' => 0,
]);
DB::table('tasks')->insert([
'id' => 777777,
'task_name' => 'DevTask3',
'task_desc' => 'DevTask3 Description',
'task_command' => 'rconfig:download-category',
'task_categories' => null,
'task_devices' => null,
'task_tags' => 1,
'task_cron' => '0 0 * * 0 ',
'task_email_notify' => 0,
'download_report_notify' => 0,
'verbose_download_report_notify' => 0,
'is_system' => 0,
]);
DB::table('tasks')->insert([
'id' => 888888,
'task_name' => 'DevTask4',
'task_desc' => 'DevTask4 has only unreachable devices',
'task_command' => 'rconfig:download-category',
'task_categories' => 8,
'task_devices' => null,
'task_tags' => null,
'task_cron' => '0 0 * * 0 ',
'task_email_notify' => 1,
'download_report_notify' => 0,
'verbose_download_report_notify' => 0,
'is_system' => 0,
]);
DB::table('tasks')->insert([
'id' => 999999,
'task_name' => 'BackupTask1',
'task_desc' => 'BackupTask1',
'task_command' => 'backup:run --only-to-disk=rconfig',
'task_categories' => 8,
'task_devices' => null,
'task_tags' => null,
'task_cron' => '0 0 * * 0 ',
'task_email_notify' => 0,
'download_report_notify' => 0,
'verbose_download_report_notify' => 0,
'is_system' => 0,
]);
DB::table('device_task')->insert([
'device_id' => 1001,
'task_id' => 555555,
]);
DB::table('device_task')->insert([
'device_id' => 1002,
'task_id' => 555555,
]);
DB::table('tag_task')->insert([
'tag_id' => 1002,
'task_id' => 666666,
]);
DB::table('category_task')->insert([
'category_id' => 1,
'task_id' => 777777,
]);
DB::table('category_task')->insert([
'category_id' => 2,
'task_id' => 777777,
]);
DB::table('category_task')->insert([
'category_id' => 3,
'task_id' => 777777,
]);
DB::table('category_task')->insert([
'category_id' => 8,
'task_id' => 888888,
]);
}
}

View File

@@ -0,0 +1,99 @@
<?php
namespace Database\Seeders\testdata;
use App\Models\Device;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
class HPProcurveDeviceSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = \Faker\Factory::create();
$device_id = 30001;
$cat_id = 30001;
$command_id = 5189;
$template_id = $faker->randomNumber(4);
$template_url = 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/HP/hp-procurve-ssh-noenable-v2.yml';
$template_contents = file_get_contents($template_url);
$filename = basename($template_url);
File::put(templates_path().$filename, $template_contents);
DB::table('categories')->insert([
'id' => $cat_id,
'categoryName' => 'hp',
'categoryDescription' => null,
'badgeColor' => 'badge-primary',
'created_at' => '2020-06-06 22:20:44',
'updated_at' => null,
]);
DB::table('commands')->insert([
'id' => $command_id,
'command' => 'show running-config',
]);
DB::table('commands')->insert([
'id' => $command_id + 1,
'command' => 'show ip int brief',
]);
DB::table('vendors')->insert([
'id' => 30001,
'vendorName' => 'hp',
]);
DB::table('category_device')->insert([
'category_id' => $cat_id,
'device_id' => $device_id,
]);
DB::table('category_command')->insert([
'category_id' => $cat_id,
'command_id' => $command_id,
]);
DB::table('category_command')->insert([
'category_id' => $cat_id,
'command_id' => $command_id + 1,
]);
DB::table('templates')->insert([
'id' => $template_id,
'fileName' => '/app/rconfig/templates/'.$filename,
]);
DB::table('device_template')->insert([
'template_id' => $template_id,
'device_id' => $device_id,
]);
DB::table('device_vendor')->insert([
'vendor_id' => 20001,
'device_id' => $device_id,
]);
// SSH no enable template
Device::create([
'id' => $device_id,
'device_name' => 'mikrotik',
'device_ip' => '192.168.1.188',
'device_default_creds_on' => 0,
'device_username' => 'admin+cte',
'device_password' => 'nokia5110',
'device_enable_password' => 'cisco',
'device_main_prompt' => '[admin@routermikrotik] >',
'device_enable_prompt' => '',
'device_category_id' => $cat_id,
'device_template' => $template_id,
'device_model' => 'Mikrotik',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,99 @@
<?php
namespace Database\Seeders\testdata;
use App\Models\Device;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
class MikrotikDeviceSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = \Faker\Factory::create();
$device_id = 20001;
$cat_id = 20001;
$command_id = 5189;
$template_id = $faker->randomNumber(4);
$template_url = 'https://raw.githubusercontent.com/rconfig/rConfig-templates/master/Mikrotik/mikrotik-ssh-noenable_v2.yml';
$template_contents = file_get_contents($template_url);
$filename = basename($template_url);
File::put(templates_path() . $filename, $template_contents);
DB::table('categories')->insert([
'id' => $cat_id,
'categoryName' => 'mikrotik',
'categoryDescription' => null,
'badgeColor' => 'badge-primary',
'created_at' => '2020-06-06 22:20:44',
'updated_at' => null,
]);
DB::table('commands')->insert([
'id' => $command_id,
'command' => 'export',
]);
DB::table('commands')->insert([
'id' => $command_id + 1,
'command' => 'interface print',
]);
DB::table('vendors')->insert([
'id' => 20001,
'vendorName' => 'mikrotik',
]);
DB::table('category_device')->insert([
'category_id' => $cat_id,
'device_id' => $device_id,
]);
DB::table('category_command')->insert([
'category_id' => $cat_id,
'command_id' => $command_id,
]);
DB::table('category_command')->insert([
'category_id' => $cat_id,
'command_id' => $command_id + 1,
]);
DB::table('templates')->insert([
'id' => $template_id,
'fileName' => '/app/rconfig/templates/' . $filename,
]);
DB::table('device_template')->insert([
'template_id' => $template_id,
'device_id' => $device_id,
]);
DB::table('device_vendor')->insert([
'vendor_id' => 20001,
'device_id' => $device_id,
]);
// SSH no enable template
Device::create([
'id' => $device_id,
'device_name' => 'mikrotik',
'device_ip' => '192.168.1.188',
'device_default_creds_on' => 0,
'device_username' => 'admin+cte',
'device_password' => 'nokia5110',
'device_enable_password' => 'cisco',
'device_main_prompt' => '.*mikrotik.*', // this gets defaulted to blank once the correct template is used
'device_enable_prompt' => '',
'device_category_id' => $cat_id,
'device_template' => $template_id,
'device_model' => 'Mikrotik',
'device_version' => '',
'device_added_by' => 1,
'status' => 1,
]);
}
}