Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- start_daytime=$(date --date "$1 00:00:00" +%s)
- end_daytime=$(date --date "$2 00:00:00" +%s)
- itemid=${3:-23347}
- itemid="'"$itemid"'"
- sql_string="select * from history where value = \
- ( select max(value) from history where itemid=$itemid and \
- clock >= $start_daytime and clock <= $end_daytime) \
- and itemid=$itemid and clock >= $start_daytime and clock <= $end_daytime"
- mysql -B -s -u root -p zabbix -e "$sql_string"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement