Getting Started with iRules LX, Part 5: Troubleshooting
This applies to version 13.1.0.5
Hi @AlgebraicMirror,
I just ran into the same issue. I installed node-inspector myself in my home directory on the F5:
cd
npm install node-inspector
This puts node-inspector inside your own ~/node_modules directory. The exectutable can be found here:
~/node_modules/.bin/node-inspector
I had to do a bit of fiddling to get the node-inspector to work on the F5.
First step was to go to Local Traffic > iRules > LX Plugins and click on my plugin name.
Then there's an Extensions section, and you can click on the name of your extension.
In the Properties for your extension, change the following settings:
- Concurrency mode = single (this means you only have one nodejs process instead of multiple)
- Command options = --debug (this enables the nodejs debugger)
You might need to restart your nodejs process by clicking the "Reload from Workspace" button on your plugin.
You've now got a nodejs process listening on a port for debug messages. You can find them by:
tmsh show ilx plugin // extensions | grep Debug
(substitute your partition and plugin name)
Then you can run node-inspector:
~/node_modules/.bin/node-inspector --web-host 10.10.10.1 --no-inject --debug-host 10.10.10.1 --debug-port 20002 --ssl-key /etc/httpd/conf/ssl.key/server.key --ssl-cert /etc/httpd/conf/ssl.crt/server.crt
Note that the above command line has a few configurable parts. I found that node-inspector defaulted to localhost, and so I explicitly specify the IP address for both the place I want node inspector to connect to the debug port, and to host the inspector web site. I have used my management IP address that the F5 BIG-IP Configuration utility runs on.
The ssl key and cert allow it to run in https mode, which might be necessary depending on which browser you're using.
node-inspector will start, and print a message with the url you should browse to in your web browser:
Node Inspector v1.1.2
Visit https://10.10.10.1:8080/?port=20002 to start debugging.
You can press
Ctrl-Z
and type bg
to run that in the background, or put an & on the end of the original command.
You can also modify the url of the node-inspector web app that starts up to have a different host and port if you need to:
https://10.10.10.1:8080/?host=10.10.10.1&port=20002
You can find out about other node-inspector stuff on the node-inspector site:
https://github.com/node-inspector/node-inspector
(Note that the site suggests using the new
--inspect
flag and Chrome dev tools instead of node-inspector. The --inspect
flag appears to be disabled in the build of node on the F5, so this is not an option.)
When you connect to the website that starts up, it might be really slow to show anything on the screen. I recommend opening the web inspector / developer tools in your browser and checking the network tab is seeing lots of requests, and the Console tab doesn't have any errors.
Of course, you SHOULDN"T DO THIS IN PRODUCTION!!! Only run debug in a dev environment, VM, etc... as you'll be blocking real web requests and slow down your F5.
An alternative approach to installing the node-inspector in your home directory on the F5 is to install it on your own computer, and then connect to the F5's debug port in the command line (i.e. a different --web-host than --debug-host). I haven't tried this, but it might be better than polluting your F5 with extra files and processes taking CPU.
I hope that helps!
Kirk