Home Directory Addons APIs JSON count_lines.sh

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

count_lines.sh

Rating
0 votes
Favoured:
0
Current Version
1.02
Last Release Date
2022-01-10
Compatible With
  • Nagios XI
Owner
Hits
2486
Files:
FileDescription
count_lines.shcount_lines.sh
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
A Plugin to read files from Unit4 API, tested it on Unit4 SPE6: http://servername:port/prod/rest/api/v1/02/salesOrders?filter= This module let you split te lines with a split character and count keywords and add up amounts (In cents) It is fully written in Bash, so floating point is not possible. It also generates Graphs.
count_lines.sh Version 1.02 - Count the lines of the url we get

Usage:
./coung_lines.sh --http <'http://'> --url -u -p --warning <#minimal_lines|amount|#number of keywords> --critical <#minimal_lines critical|amount|#number of keywords> --verbose --mode --splitcharacter <,|}|>|:> --keyword

* -H | --http --> Where do we read from? http:// OR https:// OR ftp://
* -U | --url --> Enter the url without: http(s):// OR ftp://
* -w | --warning --> Warning minimal #number of lines/keywords/bytes(size)/amount
* -c | --critical --> Critical minimal #number of lines/keywords/bytes(size)/amount
-h | --help --> Show help page
-V | --version --> Show version
* -m | --mode --> Mode:
minimal_size : Minimal file size needed (File size must be bigger than Warning & Critical threshold)
maximum_size : Maximum file size needed (File size must be smaller than Warhing & Critical threshold)
minimal_lines : Minimal #number of lines must be above warning & critical Threshold
maximum_lines : Maximum #number of lines must be less than warning & critical Threshold
minimal_calc : Minimal amount that needs to be calculated before warning (Threshold only workss with whole integers)
maximum_calc : Maximum amount that needs to be calculated before warning (Threshold only workss with whole integers)
minimal_keyword : Minimal number of keywords that needs to be found before warning
maximum_keyword : Maximum number of keywords that needs to be found before warning

-k | --keyword --> Keyword: Enter keyword that you want to search, works only in MODE: minimal/maximum _keyword
| --verbose --> Show more information about the steps for troubleshooting purpuses
* -s | --splitcharacter --> With calculating the amount (-m|--mode minimal/maximal _calc you need to set a split character so the script knows
where the fields are split. Sometime all data is presented on one line, then use the split character to split
the line into sperate lines so the script can pars ethe whole thing
-p | --password --> Enter a password if it is needed to access the url
-u | --username --> Enter a if it is needed to access the url

* --> Mandatory