LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LQ Suggestions & Feedback (https://www.linuxquestions.org/questions/lq-suggestions-and-feedback-7/)
-   -   Basic LQ troubleshooting list or tool (https://www.linuxquestions.org/questions/lq-suggestions-and-feedback-7/basic-lq-troubleshooting-list-or-tool-4175595364/)

szboardstretcher 12-13-2016 02:23 PM

Basic LQ troubleshooting list or tool
 
Have we ever discussed having a troubleshooting tool that we could refer users to?

Something like:

./lqdebug.sh --samba-setup

to grab the same four command outputs that we always ask for? Dell and Atlassian have that sort of thing for their products. But a general tool might be nice for the forum.

frankbell 12-13-2016 07:50 PM

I've got a lot of experience putting together troubleshooting flow charts and other job aids for training classes. I would be happy to work with a person or team interesting in putting together some troubleshooting aids.

szboardstretcher 12-14-2016 10:25 AM

Very interesting. I'll mock up a basic idea and add it to github. I'll link back when I have something concrete. From there if you are interested, you may freely contribute.

szboardstretcher 12-14-2016 11:02 AM

A very simple mockup is available here: https://github.com/boardstretcher/ldebug

The idea is this,.. "User: I have a problem with my mount point not mounting" "Me: run 'ldebug.sh -s' and copy and paste the contents here."

The contents would have for example, /etc/fstab, /proc/mounts, lvs, pvs, blkid, fdisk -l, and that sort of thing. Very simple and very centralized for anyone to be able to easily run:

Code:

wget https://whatever/ldebug.sh; ./ldebug.sh -s;
Done. Rather than posting 4 different times to get the information that we will eventually need anyway, I'd like to get a complete picture right off the rip.

Thoughts? I figure 'storage' would be the first area. Then maybe 'generalsystem'. Then maybe 'networking'. Maybe 'packagemanager'. Anyway, hope its interesting enough to warrant some collaboration and effort.

frankbell 12-15-2016 03:38 PM

I'm afraid scripts are not my strong point. I did download this and try to run it in one of my VMs and got

Code:

$ sh ldebug.sh -s
ldebug.sh: line 5: syntax error near unexpected token `newline'
ldebug.sh: line 5: `<!DOCTYPE html>'

but I like the idea. I might take a whirl at a simple one to collect information about wireless chipsets, since that bugs a lot of people.

Guess I'd better read up on how to use Github, too, to do something other than download!

syg00 12-15-2016 07:40 PM

You pulled the webpage, not the script. This is a problem with this sort of thing - seen similar when directing users to download bootinfoscript.
One needs to be very specific with instructions.

frankbell 12-15-2016 08:18 PM

Quote:

You pulled the webpage, not the script
(Grin) I said I'm not very experienced with Github. I'll try to educate myself tomorrow.

Oddly enough, when I saw the doctype, I tried to open the file from Firefox and the file-open dialog told me I was trying to open a script and pointed me towards Gedit. I am guessing that was based on the file name. (Moments later) I just verified my guess by copying the file to one with an html extension and opening it in Firefox.

Thanks for teaching me something.

szboardstretcher 12-15-2016 10:19 PM

No prob. The link to the actual script im working on is:

https://raw.githubusercontent.com/bo...ster/ldebug.sh

Just a hobby project. Not serious. Maybe it will be useful eventually. Feel free to suggest additions or get on github and offer code.

frankbell 12-16-2016 08:27 PM

I found the script on my own:). It seems to run quite nicely. I do have some ideas for some other information to automate the seeking of which, he said ungrammatically; I think I will work on them and then run them by you. Let me know the best way to do that.

I'll have to bone up on scripting, though; fortunately, I have my Garrels book on scripting on the bookshelf. It's been a while since I wrote anything more complex than my Fluxbox wallpaper script:

Code:

#!/bin/sh

while true; do
#      fbsetbg -f -R ~/wallpapers
      fbsetbg -f -R ~/Christmas
        sleep 30m


szboardstretcher 12-16-2016 11:59 PM

Cool. If you haven't used github, it might be worth it to grab an account and learn to use the pull request system. Basically you press 'fork' on this script, make your changes to your own copy of it, then do a pull request which essentially comes back to me and says 'would you like these changes added to the script?'

Its a good way for many of us to work on it.

Or you can suggest them here. Up to you. If there get to be lots of ideas and input we would have to go the github route.

Now,. on the scripting front. If you aren't up to speed on scripting, then you could offer command collections - Since we are really just looking to quickly display relevant information. For example:

Quote:

You: Hey I have some information gathering commands all related to the category "Programs and Packages" here are the commands:

rpm -qa
yum repolist
And I could just add it to a 'Programs and packages' section of the script. Any help is certainly appreciated. Have fun!

frankbell 12-17-2016 09:43 PM

I think I shall open a git-hub account and check out some tutorials. I'm sure I'll have questions.

This would be a great opportunity for me to learn more about scripting; I've found one learns best when one has a goal. If I'm not satisfied with my progress, I'll post my suggestions here.

Thanks for the encouragement.

szboardstretcher 12-17-2016 11:11 PM

Any time. Im not an expert, but I enjoy the process. Looking forward to your collaboration.

frankbell 12-18-2016 08:09 PM

I look forward to working on this also and to learning stuff.

I was poking at your script today and reading up on functions when I ran into this:

It runs just fine on Slackware and CentOS v. 7 (in a VM), but when I run it in Mint v. 17 or Debian v. 8, I get this:

Code:

# sh ldebug.sh
ldebug.sh: 44: ldebug.sh: Syntax error: "(" unexpected

I admit this has me baffled. If you count empty and remarked out lines, line 44 is this:

Code:

function get_general(){
(If you don't count empty and remarked out lines, line 44 would be line 63, which is blank, if I counted correctly.)

I tried a shot in the dark, based on something in Garrels Intro to BASH Scripting, and added a space before the first paren, but still got the error.

In the meantime, I'll keep poking at a wireless information collection script. I'm hoping to have a not-too-incompetent draft by midweek.

szboardstretcher 12-18-2016 11:23 PM

Good catch! Hmmm. I wonder if debian wants the () removed completely... I will spin up a debian instance to test on as well so I can cover Centos/Debian variants at least.

I've also updated the script to remove the wordiness of the $(which) stuff I was doing. Created a tmpfile.. And also added a way to automatically send the output to a pastebin online the -Z switch in the newest version. So running './ldebug.sh -lZ' gets regular output, sends it to a pastebin, and outputs this line:

Copy, Paste and Share this pastebin URL:
http://sprunge.us/MaGC

Which i think is nice.

frankbell 12-19-2016 08:17 PM

Quote:

I've also updated the script to remove the wordiness of the $(which) stuff I was doing.
I will be testing on it and, I am confident, learning from it tomorrow. Thanks.


All times are GMT -5. The time now is 05:27 PM.