base
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
/****************************************************************************
|
||||
Broadcast Message Header for rc_mond
|
||||
-----------------------------------------
|
||||
|
||||
begin : 2015/06/05
|
||||
copyright : (C) 2005 Solbox Inc.
|
||||
author : Dev Storage Team
|
||||
email : huibong@solbox.com
|
||||
version : 3.5
|
||||
|
||||
CopyRight(C) 2005 Solbox Inc. All Rights reserved.
|
||||
Redistribution and use in source and binary forms, with or with out
|
||||
modification, are not permitted in outside of Solbox Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __PROTOCOL_VMASD_H__
|
||||
#define __PROTOCOL_VMASD_H__
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
// 본 Header 파일은 FHS 의 vmasd 가 전송하는 UDP Broadcasting Message Protocol 을 정의하기 위한 header 이다.
|
||||
// FHS vmasd 에 정의된 Protocol 형식이 향후 변경될 수 있으므로.. 다음과 같이 특정하여 처리한다.
|
||||
// sizeof( struct vmasd_broadcast_message_header ) => 352 (64Bit OS)
|
||||
|
||||
struct vmasd_broadcast_message_header {
|
||||
|
||||
char szTransactionID[52]; // 20130802181203-4ef48917f7-4381644055 ( 세션 ID 정보 )
|
||||
uint32_t ulMode; // 256 (MODE 정보, network byte odrer, 0x0100 만 사용)
|
||||
char szIssuer[128]; // vmasd (프로세스명)
|
||||
char szServiceID[128]; // 미사용
|
||||
char szRCID[32]; // bd16 (RC ID)
|
||||
uint32_t ulResult; // 4096 (처리결과, network byte odrer)
|
||||
uint32_t ulBodyLength; // 640 (Body Size , network byte odrer)
|
||||
|
||||
};
|
||||
|
||||
// vmasd 가 전송한 UDP Broadcast 메시지 중....
|
||||
// vmasd_broadcast_message_header 구조체에서 ntohl(ulMode) == MSG_MODE_VMA_APACHE_DISKSIZE 정보만 처리한다.
|
||||
#define MSG_MODE_VMA_APACHE_DISKSIZE 0x0100
|
||||
|
||||
// rc_vrcd share.h 에 정의된 struct disk_usage 구조체 및 vmasd 소스 참고함.
|
||||
// 구조체 명은 변경 처리함.
|
||||
// sizeof( struct vmasd_broadcast_message_body ) => 640 (64Bit OS)
|
||||
// 각 항목에 대한 설명 내역은 vmasd 소스 Revision 0551 을 기준으로 한 분석 내역임.
|
||||
struct vmasd_broadcast_message_body {
|
||||
|
||||
char domain[512]; // vmasd.conf에 설정된 SERVER_NAME=sb-01-fhs001.solbox.com 정보 사용
|
||||
// 해당 정보는 FHS 패키징 설치시 hostname 정보를 추출하여 자동 설정 처리하므로..
|
||||
// hostname 정보와 동일하다.
|
||||
|
||||
uint64_t total; // 저장 경로로 지정된 Mount 의 총 Disk Size ( 각 mount statfs 의 f_blocks * f_bsize 합산 결과 )
|
||||
uint64_t free; // 저장 경로로 지정된 Mount 의 총 Disk Free Size ( 각 mount statfs 의 f_blocks * f_bavail 합산 결과 )
|
||||
// 본 total, free 값은 /stg/node0.disable 설정에는 영향받지 않음.
|
||||
|
||||
int manual_disable; // 2 : fsck_ufs 프로세스가 동작 중인 경우..
|
||||
// 1 : /user/service/vmasd.disable 파일이 존재할 경우..
|
||||
// .disable 설정이 되지 않은 유효 Mount 중.. 가장 큰 Free Disk 용량(f_bfree) 이 0 인 경우...
|
||||
// 0 : 그 외..
|
||||
|
||||
int upload_level; // 본 구조체 항목 중 (disk_backlog/10) + (connection_established/50) 의 계산 값... ( vmasd 소스 참고)
|
||||
|
||||
int disk_backlog; // 저장 경로 Mount의 Disk Queue 평균 대기 transaction 수
|
||||
// 실제로는 평균이 아니라.. N개 mount 중 마지막 mount 의 추출 값임.
|
||||
// 세부 내역은 devstat_compute_statistics 의 DSM_QUEUE_LENGTH 참고
|
||||
|
||||
int disk_percent; // 저장 경로 Mount 들의 평균 Busy 율 ( devstat_compute_statistics 의 DSM_BUSY_PCT 참고 )
|
||||
|
||||
int connection_established; // TCP 80 Port 사용, ESTABLISH 상태인 세션 수..
|
||||
int connection_total; // TCP 80 Port 전체 세션 수.
|
||||
|
||||
uint32_t traffic_ip; // 평균 inbound packet count
|
||||
uint32_t traffic_ib; // 평균 inbound traffic ( byte/s )
|
||||
uint32_t traffic_op; // 평균 outbound packet count
|
||||
uint32_t traffic_ob; // 평균 outbound traffic ( byte/s )
|
||||
|
||||
char hostname[64]; // 장비 hostname (gethostname 함수로 추출)
|
||||
// domain[512] 와 동일 data 임.
|
||||
// 만약 domain 정보와 hostname 정보가 다른 경우는 패키징 설치 후 장비 hostname 을 임의로 변경한 경우임.
|
||||
|
||||
uint64_t large_block; // 저장 경로로 지정된 Mount 중.... disable 설정(/stg/node0.disable)이 안되고..
|
||||
// 가장 큰 Free Size 를 가지는 Mount 의 Disk Free 용량임.
|
||||
// 본 값은 해당 FHS 에서 저장 가능한 가장 큰 Content Size 를 의미한다.
|
||||
// 본 항목은 송신측인 vmasd 에만 정의되어 있으며.. 수신측인 rc_vrcd 에는 정의되어 있지 않음.
|
||||
// 따라서.. GMS 로 본 항목은 전송하지 않는다. (전송하면 파싱 오류 발생 할 듯 )
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* __PROTOCOL_VMASD_H__ */
|
||||
|
||||
Reference in New Issue
Block a user