public class ZabbixParseDataServiceImpl implements ZabbixParseDataService {
private static final CookieManager MANAGER;
private static final String ZABBIX_FILE="";
private static final String LOGIN_URL="http://jinrongzabbix.cnsuning.com/index.php";
private static final String AGENT_STR = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36";
private static final String DATA_URL="http://jinrongzabbix.cnsuning.com/latest.php?groupid=#{GROUPID}&hostid=0";
private static final String GROUD_ID_STR = "groupId";
private static final Logger log = LoggerFactory.getLogger(ZabbixParseDataServiceImpl.class);
@Autowired
private PaymentRedisUtilService paymentRedisUtilService;
@Autowired
private ZabbixParseInfoDao zabbixParseInfoDao;
static {
MANAGER = new CookieManager();
MANAGER.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
CookieHandler.setDefault(MANAGER);
}
/**
* zabbix
* @return
*/
@Override
public void parseZabbixData(){
log.info("zabbix 。");
String resultStr= null;
try {
Map resultMap=getZabbixData();
log.info("zabbix redis {}:"+JSONObject.toJSONString(resultMap));
resultStr = paymentRedisUtilService.hmset(CommonConstants.REDIS_ZABBIX_KEY,resultMap);
} catch (Exception e) {
log.error("zabbix redis 。",e);
}
log.info("zabbix redis :"+resultStr);
log.info("zabbix 。");
}
/**
* zabbix
*/
@Override
public void parserZabbixData4DisposablePay() {
log.info("zabbix ");
List