Sponsored Content
Full Discussion: Hostsfile generator
Top Forums Shell Programming and Scripting Hostsfile generator Post 303041021 by Marti95 on Tuesday 12th of November 2019 10:08:39 AM
Old 11-12-2019
Quote:
Originally Posted by RudiC
Hmmm - I missed to post the necessary IFS modification. Try again with this slightly modified version:
Code:
IFS=$'\n'

for IN in $(echo "${!ENTRIES[*]}" | tr ',' '\n' | sort -un)
  do    [ ! "${IN/[A-Z]}" = "$IN" ] && continue
        printf "%s %s %s %s\n" "${ENTRIES[$IN",IP"]}" "${ENTRIES[$IN",HOST1"]}" "${ENTRIES[$IN",HOST2"]}" "${ENTRIES[$IN",COMMENT"]}"
  done

perfect!
Now its working
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

Password Generator

I need a great Password Generator program. I looked at a few of them, but none of them seemed to be what I wanted. So I have decided to write my own. (That's the cool thing about being a programmer....I always get what I want in software :) ) Do you have any password generators that you... (13 Replies)
Discussion started by: Perderabo
13 Replies

2. UNIX for Dummies Questions & Answers

date generator

Is there a command to generate the unix date that is in theshadow file?>? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

3. Shell Programming and Scripting

How to compare result lpstat with hostsfile

Hi there all, I got a long list of printers installed and a longer list of printers in my hosts file. In the hosts file I got a even longer list of printers in the hosts file I got the IP adress of all printers next to the printer name. How can I get a script working to get the printers... (0 Replies)
Discussion started by: draco
0 Replies

4. Shell Programming and Scripting

Range generator

Dear All, I have a sorted file like 1 2 3 8 9 10 45 46 47 78 The output will be range like 1 3 8 10 45 47 78 78 (9 Replies)
Discussion started by: saifurshaon
9 Replies

5. Shell Programming and Scripting

Random Sentence Generator

Hi, I need to create a table with random sentences. I need lines that are upto 1000 characters in lenght. I need a random sentence generator that will create sentences and output it to a text file. The sentences should be of lenght varying from 1 to 1000. Does anyone know how this can be... (7 Replies)
Discussion started by: kaushys
7 Replies

6. What is on Your Mind?

Barcode Generator

QR Code Generator (0 Replies)
Discussion started by: Neo
0 Replies

7. Shell Programming and Scripting

time generator

Hi experts, I'd like to generate the table/file containing: number of milliseconds elapsed since midnight till midnight. It should contain 5 columns (hours minutes seconds milliseconds): Table will have theoretically 86 400 000 rows. My question is , is there somewhere the file or source... (7 Replies)
Discussion started by: hernand
7 Replies

8. Shell Programming and Scripting

Sequence generator

Thanks Guys This really helped (5 Replies)
Discussion started by: robert89
5 Replies

9. Shell Programming and Scripting

Generator script

Hello again unix.com people, I need your help again. I'm currently need a script that will generate ip ranges... lets say from 64.1.1.1 to 74.255.255.255 and the output should be like this: 64.1.1.2 64.1.1.3 ............. ............. 74.255.255.254 74.255.255.255 (line-by-line) ... (7 Replies)
Discussion started by: galford
7 Replies
BB-HIST.CGI(1)						      General Commands Manual						    BB-HIST.CGI(1)

NAME
bb-hist.cgi - CGI program to display service history SYNOPSIS
bb-hist.cgi DESCRIPTION
bb-hist.cgi is invoked as a CGI script via the bb-hist.sh CGI wrapper. It is passed a QUERY_STRING environment variable with the following parameters: HISTFILE (a Xymon service history file) ENTRIES (the number of entries to show) The following non-standard parameters are handled by the bbgen version of bb-hist.cgi: IP (IP address of host - for display purposes only) PIXELS (width of colorbar when in pixel-mode) ENDTIME (when the colorbar begins, a time_t value) BARSUMS (which colorbars and summaries to show) bb-hist.cgi analyses the service history file for changes that have occurred within the past 24 hours, and build a colorbar showing the status of the service over this period of time. A statistics summary is also produced, listing the amount of time for each status (green, yellow, red, purple, blue, clear). Finally, a summary of the last N events is given, with links to the actual event logs. Unlike the standard bb-hist.sh script, bb-hist.cgi provides a colorbar and statistics summaries also covering the past 1 week, 4 weeks and 1 year of data. Via links it is possible to browse the entire history of the service at the requested interval. Note that since the resolution of the display is limited, events may be too short to show up on a colorbar; also, the exact placement of an event may not fully match up with the time-markers. The graphs should correctly handle the display of months with different number of days, as well as the display of periods that involve beginning and end of Daylight Savings Time, if this occurs in your timezone. All dates and times shown are in local time for the timezone defined on the BBDISPLAY server. PARAMETERS
HISTFILE Defines the host and service whose history is presented. ENTRIES The number of log-entries to show in the event log table. Default is 50; to view all log entries set this to "ALL". IP The IP-address of the host. This is only used for the title of the document. PIXELS The width of the colorbar graph in pixels. If this is set to 0, a percentage-based graph will be shown, similar to the one provided by the standard bb-hist.sh script. Pixel-based graphs can have a higher resolution, but do not resize automatically to suit the size of a browser window. The default value for this parameter is defined at compile-time; 960 is a good value for displays with a 1024x768 resolution. BARSUMS Defines which colorbars and summaries to show. This is a number made up from a bitmask. The 1-day graph uses the value "1"; the 1-week graph uses the value "2"; the 4-week graph uses the value "4" and the 1-year graph the value "8". To show multiple graph, add the values - e.g. "6" will show the 1-week and 4-weeks graphs, whereas "15" will show all the graphs. The default is defined at compile-time. ENDTIME The history display by default ends with the current time. Setting the ENDTIME parameter causes it to end at the time specified - this is given as a Unix "time_t" value, i.e. as the number of seconds elapsed since Jan 1 1970 00:00 UTC. OPTIONS
--env=FILENAME Load the environment from FILENAME before executing the CGI. SEE ALSO
bb-hosts(5), hobbitserver.cfg(5) Xymon Version 4.2.3: 4 Feb 2009 BB-HIST.CGI(1)
All times are GMT -4. The time now is 06:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy