Code Monkey home page Code Monkey logo

truenas-scripts's Introduction

A Collection of Scripts For TrueNAS

FanControl.tool

FanControl.tool {-c configFile} {-t|-f|-d}

This tool is meant to control case fans via ipmi to maintain target disk and HBA temperatures using a PID control loop on TrueNAS Core. It also allows you to get a readout of current temps and fan speeds.

The first run of the script will write out a default config file to the specified location; this file will need to be edited to conform to your system.

Most of the first sections of the config file should be fairly self explanatory, so starting with lsi_temp in the List of HBAs section: this is the path to a compiled binary of the lsi_temp helper program which gets the temp of LSI HBA cards that support it (SAS 3+ generally)

hbaName is a list of both HBAs and expanders that support temp sensors.

Temp sensors: This section allows you to specify what the motherboard temp sensors will be used for.

The hbaTempSens array is useful if your motherboard supports thermal probes and you have a HBA card that does not support temperature reporting.

The ambTempSens array is to specify which sensors mesure the internal ambient temperature of the case.

IPMI Fan Commands: This section allows you to customise the commands to both read and write fan speeds. All of these commands will need to be customised for both the motherboard you are using and how fans are attached to it.

The ipmiWrite function is used to write the PWM levels for each fan as a value from 0 - 100; this command is specific to a particular model of board, consult your board manufacture to get the correct command.

The ipmiRead function is used to read the PWM levels for each fan as a value from 0 - 100 in hexadecimal; this command is specific to a particular model of board, consult your board manufacture to get the correct command.

It is suggested that following invocation be used to run this script from a Post Init task:

/usr/sbin/daemon -t "FanControl" -P "/var/run/daemon-FanControl.pid" -p "/var/run/FanControl.pid" -Ss "info" -T "FanControl" -R "60" <path>/FanControl.tool -dc "<path>/FanConfig"

ipfw.rules

A script to setup ipfw to force all non lan trafic from the transmission user through the first listed tun device. For use with the pia-port-forward.sh script.

jls.tool

This a script to automate the creation of jails; modification of the generated config file be required for your setup.

pia-port-forward.sh

This is a script to maintain a pia vpn connection with an open port for transmission. It is intended to be run via cron at intervals of less than 15 mins from within the jail running transmission and openvpn.

This script generally expects to be run form a jail created via jls.tool -c jls.cfg -t transmission.

The vpnDir will need to be set to the location of the openvpn config directory.

The firewallScript needs to be set to the location of the ipfw.rules file.

search.cmd

A command to initiate crawls from within the search jail as setup by jls.tool -c jls.cfg -t search.

suite-definition.xml

A configuration file for the phoronix-test package.

tlerActiveation.tool

A script to activate Time Limited Error Recovery on drives that do not remember this setting between reboots. This is intended to be run as a Post Init task.

truenas-scripts's People

Contributors

dak180 avatar edjerf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

truenas-scripts's Issues

Failed to bind the port: Bad Gateway; Incorrect gateway address

when i run the script i get this log output:

| Transmission Port Forward 2023-06-23 14:23:16
| VPN connection up.
| Closed port detected.
| Loading port forward assignment information..
| New port: 37600
| Failed to bind the port: Bad Gateway; Incorrect gateway address

The first time i ran it, it complained about there not being a file at /tmp/piaPort/gateway.txt, so i created one. Now i get the above mentioned error. Should i have something in the gateway file. I don't see anything that suggests what goes there.

I am running this in a jail on FreeNas

pia-port-forward typo?

pia-port-forward looks interesting. It looks like you have 2 spellings: adapterName and adaptorName. Is that intentional? I guess if they are defined locally in each function, it can still work, but maybe confusing.

Fan Control Script How To

I downloaded the script and placed it in a folder in home dir.
Changed the defaultFile from 1 to 0 and saved.
Renamed from .tool to .sh
chmod +x on the file.

Then tried running via ./fancontrol.sh
And it says Please configure a config file location

How/where am I supposed to do this?

Linux bash (may not be at all relevant)

I'm not sure if this is at all relevant to you, given your "...specifically in FreeBSD" comment. But I ported pia-port-forward.sh to Debian GNU/Linux and ran into problems with line 163: the | jq -Mre produces a multi-line output and this breaks the assignment to the variable. Removing it produces a single line which can be assigned to $json. I got so frustrated, I even asked on StackExchange and somebody there told me "bash is bash" and I should tell you.

Otherwise: Thanks a lot for your work! I really dreaded modifying 912 lines of PIA scripts for my purpose (just simple PF), you made my live much easier!

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.