ZFS Server
is a user editable web-gui especially but not only for Nexenta 3 (free core edition). Most of it will work on opensolaris or eon. Some additions like grouping requires additional software (socat) or addition perl-modules.
File structure
Napp-it is a copy and run web application. Copy and run means, you just have to copy napp-it to your cgi-bin folder with winscp to handle ascii files and set permissions of napp-it folder to 777 recursively (napp-it will adjust all right automatically).
Files and folders within napp-it folder:
1. napp-it core files in ..cgi-bin/napp-it/
admin.pl and admin-lib.pl
you will only need these two files to have napp-it running. napp-it will create all other needed folder on first login
2. Os-folder ex cgi-bin/napp-it/sunos
if you do not have a os-folder, napp-it will create a default folder. napp-it zfs server has a sunos folder with menues and actions for Nexenta or Opensolaris.
3.Logfolder for logs and settings ..cgi-bin/napp-it/_log
Napp-it stores temp-files, jobs and settings within this folder.
This Folder is not changed on updates to keep settings.
4. Private folder for user add-ons and menue modifications ..cgi-bin/napp-it/_my
Within the my-folder, you can store your settings, your libaries and actions and your menues.
The my-folder is not changed on napp-it updates to keep settings. The my folder contains a os-folder ex /_my/sunos for your privat menues and actions. Napp-it will merge menues from this folder with menues in /napp-it/sunos.
File types
you have basically three types of files within napp-it
1. actions
If you create a main menue item, you will create a folder in /cgi-bin/sunos/ for this menue item with a file action.pl within. action.pl is a textfile/ script in perl to handle the menue item. You can edit this file within napp-it or with your preferred editor. The Name of the folder is your main menue item (short from thirst space). you can remae or move this folder. spaces are allowed. If you create a submenue Item, its folder with a action.pl within and with the same options. If you edit this file within napp-it you will have a syntax check on save and a three stage file-save undo.
2.libraries with functions for manipulation something
usually you have more than one menue item, needing the same functions. its a good idea to save such functions in libraries. libraries should be named xxxlib.pl for ex. zfslib.pl. all functions within should be named xxxlib_... ex zfslib_list_pools() to have them autoloaded on runtime if they are stored in /napp-it/sunos/_lib or in your folder for your own add-ons /napp-it/my/sunos/_lib
3. gethash functions to fill public hashes with values
one basic idea behind napp-it are public hashes. hashes are named lists of values for ex hash disk. if you name these functions get-xxx.pl, they are autoloaded, if you are requesting a value within. for ex. if you need the capacity of disk c1cd0t0, and you have somethinge like $capacity=$disk{'c1d0td0_cap'} within you script, getdisk.pl is autoloaded to collect all neede disk information in the public hash disk. in editmode, you can diplay the content of these hashes. this is very helpful for scripting and bugfixing. you have the following hashes: in, sys, disk, zfs and current. if you need special disk-informations, you create files like getdisk-smart.pl to collect additionl smart-infos. these files are autoloaded if you use something like $disk{'smart_..'}. gethash-files could be stored in /napp-it/sunos/_lib or for your own files in /napp-it/_my/sunos/_lib
First steps
1. activate edit-mode
go to menue napp-it setuo and set editing to always
2. create a main menue item test
klick on add l1 and enter test
you could name it like 03_test to have the items sorted (00_ is not displayed) or you could name it test' to save it in your private _my folder (add a single quoted to name').
napp-it via https
suggestions from Rick:
1) change line 4 of /etc/init.d/napp-it from
/var/web-gui/tools/httpd/napp-it-mhttpd -c **.pl -u napp-it -d /var/web-gui/wwwroot -p 81
to
/var/web-gui/tools/httpd/napp-it-mhttpd -c **.pl -u napp-it -d /var/web-gui/wwwroot -p 81 -S -E /var/web-gui/wwwroot/mini_httpd.pem
2) use a "legit" SSL certificate, or self-sign one as follows:
a) make sure openssl-tools and sunwcsl are installed
b) run the following commands in a directory where the attached
mini_httpd.cnf file exists
openssl req -new -x509 -days 365 -nodes -config mini_httpd.cnf -out mini_httpd.pem -keyout mini_httpd.pem
openssl x509 -subject -dates -fingerprint -noout -in mini_httpd.pem
c) install the generated mini_httpd.pem file to the location pointed
to above [/var/web-gui/wwwroot]
3). call napp-it via https://serverip:81
|