CSVINFO.CGI(1)

πŸ’– CSVINFO.CGI(1) πŸ’–

okay bestie, welcome to the General Commands Manual era, this one's about csvinfo.cgi and it's actually so useful, no cap 🫢


✨ NAME ✨

csvinfo.cgi β€” a CGI program that shows you host information pulled straight out of a CSV file πŸŽ€


🌸 SYNOPSIS 🌸

csvinfo.cgi

that's it. that's the whole synopsis. she's lowkey minimal πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so csvinfo.cgi doesn't get called directly β€” she gets invoked as a CGI script through the csvinfo.sh CGI wrapper, okay? that's her whole entrance. πŸ’«

based on the parameters she receives, she goes and searches a comma-separated file for the host that matches, and then presents all the info she found as a table. it's giving organized. it's giving neat. ✨

csvinfo.cgi gets handed a QUERY_STRING environment variable with these parameters in it:

  • key β€” the string to search for, typically the hostname πŸ”
  • column β€” the column number to search, default is 0
  • db β€” the name of the CSV database file, living in $XYMONHOME/etc/, default is hostinfo.csv
  • delimiter β€” the delimiter character for columns, default is the semi-colon

CSV files are genuinely so easy to make, like you can just take a spreadsheet and export it in CSV format and boom, you're done. 🌈 you should have one host per line, and the first line should hold the column headings. and here's the plot twist: despite the whole "comma-separated" name situation, the default delimiter for CSV files is actually the semi-colon. so if you need a different delimiter, you invoke csvinfo.cgi with "delimiter=<character>" in the query string. periodt. πŸ’…


πŸ“ Example usage πŸ“

this example shows how you can use the csvinfo CGI. it assumes you've got a CSV-formatted file with info about the hosts stored as $XYMONHOME/etc/hostinfo.csv, and that the hostname is chillin' in the first column of the file. πŸ‘‘

⭐ Use with the xymongen --docurl

the --docurl option to xymongen(1) sets up all of the hostnames on your Xymon webpages so they act as links to a CGI script. iconic behavior honestly. 🫢

to invoke the csvinfo CGI script, you run xymongen with this option:

--docurl=/cgi-bin/csvinfo.sh?db=hostinfo.csv&key=%s

πŸ‘‘ SEE ALSO πŸ‘‘

hosts.cfg(5), xymonserver.cfg(5), xymongen(1)


and that's the whole page bestie, you ate that reading session fr fr πŸ’– this was Xymon, Version 4.3.30, dated 4 Sep 2019 β€” go forth and slay those host lookups πŸŒŸπŸ’…

πŸ“¦ where this page comes from